I am testing some code on the iPhone 5 simulator. The method below does not seem to work in the simulator. What happens is the picker is dismissed, but no image is added to the imageView. Strangely this exact code was working in the iOS 6 iPhone simulator earlier in the week, I am pretty certain.
-(void)imagePickerController:didFinishPickingImage:editing Info:
I think it is a deprecated method, but I also tried the method below. It also does not work in the simulator. The image logs as NULL. Both methods seem to work fine with iOS 5 and 6 devices.
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[self dismissModalViewControllerAnimated:YES];
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
//if (!image) image = [info objectForKey:UIImagePickerControllerOriginalImage];
[importedImageView setImage:image];
NSLog(@"image picked");
if (image == NULL) {
NSLog(@"NULL");
}
I uploaded the project for anyone curious or kind enough to take a look. owolf.net/uploads/StackOverflow/IPhone5Test.zip
Thanks for reading.