Reputation: 95
I am using the method below to get an image. What is the 'info' format and how am I going to save it into NSURL? I want to save the NSURL of the image into my core data.
-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info{
[picker dismissModalViewControllerAnimated:YES];
self.photo = [info objectForKey:UIImagePickerControllerEditedImage];
}
Upvotes: 0
Views: 283
Reputation: 17622
Here is the description of all the keys in the info
dictionary (scroll down to the Constants section).
If you want the URL of the image, use
UIImagePickerControllerReferenceURL
.
If you want to save the image itself to your Core Data store, use
UIImagePickerControllerOriginalImage
or
UIImagePickerControllerEditedImage
, which will give you a UIImage
object of the picture picked by user.
Upvotes: 1