I’m trying to call a UIImagePickerController and use the info that it gets to update a UIImageView. I can’t get the UIImage from the info to the UIImageView.
- (void)imagePickerController:(UIImagePickerController *)picker
didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage* originalImage = nil;
originalImage = [info objectForKey:UIImagePickerControllerOriginalImage];
[myImage setImage:originalImage]; //also tried myImage.image = originalImage
NSLog(@"originalImage: %@\n", originalImage);
NSLog(@"userImage.image: %@\n", myImage.image);
[self dismissViewControllerAnimated:YES completion:nil];
}
When I run this code the UIImageView stays blank.
I get a console output of:
originalImage: <UIImage: 0x80e0f90>
userImage.image: (null)
myImageis null, so any call on it has no effect, something should be assigned to it beforehand (myImage = ...orself.myImage = ...)