Instead of saving that captured image in Photo album before edit why not you save it in Document folder of application. To edit the photo take it from document folder and then save that edited photo into photo album. If you want to get that photo from photo album then you have to show image picker controller for same. So i suggest save it in Document folder. Also getting photo from Document folder is faster.
- (IBAction)saveImage
{
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *savedImagePath = [documentsDirectory stringByAppendingPathComponent:@"savedImage.png"];
UIImage *image = imageView.image; // imageView is my image from camera
NSData *imageData = UIImagePNGRepresentation(image);
[imageData writeToFile:savedImagePath atomically:NO];
}
- (IBAction)getImage {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *getImagePath = [documentsDirectory stringByAppendingPathComponent:@"savedImage.png"];
UIImage *img = [UIImage imageWithContentsOfFile:getImagePath];
}
To remove the image
NSFileManager *fileManager = [NSFileManager defaultManager];
[fileManager removeItemAtPath:cImagePath error:nil];
cImagePath will be the path of image