1

in my app im using UIImagePickerController to pick an image. i want to get a NSURL leading to that image. in "didFinishPickingImage" method i tried using "UIImagePickerControllerReferenceURL" and "UIImagePickerControllerMediaURL" properties like some threads in stackoverflow suggested, however they both returned NULL as url.

this thread talked about something similar - however they discuss getting the image itself and not the URL, and i couldnt quite understand how to end up with a NSURL leading to my gallery image.

this is my current code:

- (void)imagePickerController:(UIImagePickerController *)picker 
                              didFinishPickingImage:(UIImage *)image 
                              editingInfo:(NSDictionary *)editingInfo
{

    NSURL *imageUrl = [editingInfo valueForKey:UIImagePickerControllerReferenceURL];

    NSString *stringFromURL = [imageUrl absoluteString];
    NSLog(@"%@", stringFromURL);  // this shows i do get (null)

    // ....
}

Thank you for your time!

Community
  • 1
  • 1
Zephyer
  • 333
  • 6
  • 16

0 Answers0