Here is a function to save an image to the Documents folder. Just pull the image in the delegate
Code:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
UIImage *image = (UIImage *)[info objectForKey:UIImagePickerControllerOriginalImage];
[self saveImagePNG:image withName:@"someimagename.png"];
}
Here is the method to save the image:
Code:
#define DOCSFOLDER [NSHomeDirectory() stringByAppendingPathComponent:@"Documents"]
- (void) saveImagePNG:(UIImage *)image withName:(NSString *)imageName{
//get the image data
NSData *tempData = UIImagePNGRepresentation(image);
//save it to the documents folder
NSString *filePath = [DOCSFOLDER stringByAppendingPathComponent:imageName];
[[NSFileManager defaultManager] createFileAtPath:filePath contents:tempData attributes:nil];
}