I’m saving an image from the iPhone camera and I manage the delegate method:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
here I need to know:
[info objectForKey:UIImagePickerControllerReferenceURL]
but it is always nil if I just took a picture, if different from nil load a picture from the camera roll.
Why is that?
If you capture a video, the media is saved on device’s storage, and you can access its URL.
If you capture an image, the media is saved into device’s memory, and you can access its raw data.
EDIT: you asked why an image’s URL is nil. As you can see, a captured image is never saved on device’s storage. One advantage to have picture in memory is that you can process it before storing it on device or sending it over a network.