After I choose a picture through the UIImagePickerController interface from the Photo Library, the Photo Library view stays displayed, even though I've called dismissModelViewControllerAnimated in imagePickerController:didFinishPickingImage:editingInfo.
Has anyone seen this? These are the three relevant methods I'm using:
- (IBAction)choosePictureFromLibrary:(id)sender {
if ([UIImagePickerController isSourceTypeAvailable:UIImagePickerControllerSourceTypePhotoLibrary]) {
UIImagePickerController* picker = [[UIImagePickerController alloc] init];
picker.delegate = self;
picker.allowsImageEditing = YES;
picker.sourceType = UIImagePickerControllerSourceTypePhotoLibrary;
[self presentModalViewController:picker animated:YES];
[picker release];
}
else {
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Error accessing Photo Library" message:@"This device does not support a Photo Library." delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
}
}
- (void)imagePickerController:(UIImagePickerController*)picker didFinishPickingImage:(UIImage*)image editingInfo:(NSDictionary*)editingInfo {
UIAlertView* alert = [[UIAlertView alloc] initWithTitle:@"Picture picked!" message:@"You picked a picture!" delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil];
[alert show];
[alert release];
[picker dismissModalViewControllerAnimated:YES];
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController*)picker {
[picker dismissModalViewControllerAnimated:YES];
}
I would have thought that calling imagePickerController:didFinishPickingImage:editingInfo would completely dismiss the Photo Library view, but it doesn't seem to. Is there anything else I have to do to make it go away?