I allow the user to select an image from the gallery or take pictures with the camera. I would keep the image path in both cases so that I can use it to display the image at a different time.
When a user selects an image from the gallery, I can use
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
if([[info valueForKey:@"UIImagePickerControllerMediaType"] isEqualToString:@"public.image"]) {
NSURL *imageUrl = [info valueForKey:@"UIImagePickerControllerReferenceURL"];
}
}
Instead, if the user takes the photo on the fly, I save it in a roll of photo:
UIImage *image = [info objectForKey:@"UIImagePickerControllerOriginalImage"];
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
After saving, I would like to get the corresponding NSURL when the user selected it.
How can i do
EDIT
, . URL-, UIImagePickerControllerReferenceURL. , . , ,
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
, UIImagePickerControllerReferenceURL URL-.