I have a simple UIImagePickerControllerone that tries to capture 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];
}
By 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 am using 4.0 as the base SDK and targeting 3.1.3 at the moment. Running simulator 4.0, the collection of information contains only:
2010-07-07 16:19:33.414 ******[516:307] Info: UIImagePickerControllerMediaType
On a device or run in an 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? It was perfect before I updated SDK 4.0. I have no warnings, etc.
Obviously, without the original image in the simulator, I cannot show or do anything with the selected image, since I have no idea what it is.