I am using this link(http://www.raywenderlich.com/18840/how-to-make-a-simple-drawing-app-with-uikit) for making a paint application and I want to perform a undo operation as well.
I used this code to save every sketch made by the user in an mutable `array[completeLines]. These changes are done in touchesEnded method
**UIGraphicsBeginImageContextWithOptions(_tempDrawImage.bounds.size, NO,0.0);
[_tempDrawImage.image drawInRect:CGRectMake(0, 0, _tempDrawImage.frame.size.width, _tempDrawImage.frame.size.height)];
UIImage *image = UIGraphicsGetImageFromCurrentImageContext();
[completeLines addObject:image];**
And, on pressing the undo button I want to remove the last sketch from the view. Help me out in getting out the image reference from the mutable array and to remove it from the view.