I'm using the following code to show a UIImagePickerController to take a picture:
UIImagePickerController *imagePicker = [[UIImagePickerController alloc] init];
[imagePicker setDelegate:self];
[imagePicker setSourceType:UIImagePickerControllerSourceTypeCamera];
[self presentViewController:imagePicker animated:YES completion:nil];
Note: self is a UIViewController embedded inside a Container View, which itself takes part in a UINavigationController
And I have also implemented the following methods:
-(void) imagePickerController:(UIImagePickerController *)picker didFinishPickingMediaWithInfo:(NSDictionary *)info
{
UIImage *image = [info objectForKey:UIImagePickerControllerOriginalImage];
[self.imgProfile setImage:image];
[self dismissViewControllerAnimated:YES completion:nil];
}
- (void)imagePickerControllerDidCancel:(UIImagePickerController *)picker
{
[self dismissViewControllerAnimated:YES completion:nil];
}
When I either choose the picture taken or cancel it, the UIImagePickerController goes away, but also the main view disappears! With a Fade to Black.
I'm coding for iOS7 on an iPad only app, in case it has anything to do with it.
Here is a video that shows the problem. Excuse the blur, but it is under an NDA.