title: Add Images from Array to ImageView
body: <p>Im trying to do an undo function for my paint app in iOS. My approach is that after each drawing (lines, straight lines, squares, circles), the drawing will be added to an array so that I can pop/remove the lastObjectIndex of the array on undo and then repaint the contents of the array to the image view. I am using an NSMutableArray and UIImage and use UIGraphicsGetImageFromCurrentImageContext. My question is, how can I display all the image arrays into one UIImageView?</p>
  
  <p>Here is my code:</p>
  
  <pre><code>imgArray = [[NSMutableArray alloc] init];
  
  UIImage *tempImg = [[UIImage alloc] init];
  tempImg = UIGraphicsGetImageFromCurrentImageContext();
  [imgArray addObject:tempImg];
  
  UIGraphicsEndImageContext();
  
  UIGraphicsBeginImageContext(mainImage.frame.size);
  [mainImage.image drawInRect:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) blendMode:kCGBlendModeNormal alpha:1.0];
  [tempImage.image drawInRect:CGRectMake(0, 0, self.view.frame.size.width, self.view.frame.size.height) blendMode:kCGBlendModeNormal alpha:opacity];
  mainImage.image = tempImg; //UIGraphicsGetImageFromCurrentImageContext();
  tempImage.image = nil;
  UIGraphicsEndImageContext();
  </code></pre>