I have two view controllers, in one I pick the image from the photo library and assign it to an image property. With this picker:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)img editingInfo:(NSDictionary *)editInfo
But instead I would like to just get the address/data of the image from the picker in the first controller, push the next view controller and then open the image with that address there. So then I do the following:
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
When I print info of the photo it looks something like this:
assets-library://asset/asset.JPG?id=52219875-C221-4F60-B9D4-984AAADB6E63&ext=JPG
The problem is that UIImage has methods initWithData
or imageWithData
but these accept NSData and not NSDictionary.
How can I open an image from a photo library using its data?