I've got a simple UIImagePickerController which tries to grab the original selected image:
if ([UIImagePickerController isSourceTypeAvailable:
UIImagePickerControllerSourceTypePhotoLibrary]) {
if(defaultpicker == nil){
defaultpicker = [[UIImagePickerController alloc] init];
}
defaultpicker.delegate = self;
defaultpicker.allowsEditing = NO;
defaultpicker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:defaultpicker animated:YES];
}
Upon selecting:
- (void)imagePickerController:(UIImagePickerController *)imagepicker didFinishPickingMediaWithInfo:(NSDictionary *)info {
[imagepicker dismissModalViewControllerAnimated:YES];
NSString* key = nil;
for(key in info){
NSLog(@"Info: %@", key);
}
UIImage *theImage = (UIImage *)[info objectForKey: UIImagePickerControllerOriginalImage];
I'm using 4.0 as the base SDK, and targeting 3.1.3 at the moment. Running the 4.0 simulator, the info collection only contains:
2010-07-07 16:19:33.414 **[516:307] Info: UIImagePickerControllerMediaType
On the device, or running in the iPad 3.2 simulator I get:
2010-07-07 16:19:33.405 **[516:307] Info: UIImagePickerControllerOriginalImage
2010-07-07 16:19:33.414 **[516:307] Info: UIImagePickerControllerMediaType
Am I missing something? This was working fine before I updated to SDK 4.0. I have no warning etc.
Obviously without the original image in the simulator, I can't show or do anything with the selected image as i have no idea what it is.