i have used,the below code to store the picked image into documents directory.
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingImage:(UIImage *)image
editingInfo:(NSDictionary *)editingInfo
{
UIImage *img = [editingInfo objectForKey:UIImagePickerControllerOriginalImage];
NSData *imageData = UIImagePNGRepresentation(img);
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setTimeStyle:NSDateFormatterShortStyle];
[dateFormatter setDateStyle:NSDateFormatterShortStyle];
[dateFormatter setDateFormat:@"yyyy-MM-dd,HH:mm:ss"];
NSString *imageName = [NSString stringWithFormat:@"photo-%@.png",
[dateFormatter stringFromDate:[NSDate date]]];
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *fullPathToFile = [documentsDirectory stringByAppendingPathComponent:imageName];
[imageData writeToFile:fullPathToFile atomically:YES];
imageView.image=image;
NSLog(@"path %@",fullPathToFile);// shows the complete image path
[self dismissModalViewControllerAnimated:YES];
}
But unfortunately i cant see the picked image in the document directory, i used ‘fullPathToFile’ variable content as browser url to check it is available or not..But it is not..
asking your help.
Try this :-
Hope it helps you..