2

I have presented UIImagePickerController from modally presented view controller. After clicking the image I get a black image instead of the clicked picture I did something Like this.

//From ViewController1 I presented view controller2 with 
- (IBAction)buttontappedToPresentViewController2:(id)sender
{
    ViewController2* controller2 = [[ViewController2 alloc] initWithNibName:@"ViewController2" bundle:nil];
    controller2.modalPresentationStyle = UIModalPresentationPageSheet;
    [self controller2 animated:YES completion:nil];
}


//In ViewController2, I presented the UIIMagePickerController
- (IBAction)cameraButtonTapped:(id)sender
{
    UIImagePickerController *cameraController = [[UIImagePickerController alloc] init];
    cameraController.mediaTypes = @[(NSString *)kUTTypeImage,(NSString*)kUTTypeMovie];
    cameraController.sourceType = UIImagePickerControllerSourceTypeCamera;
    [self presentViewController:cameraController animated:YES completion:NULL];
}

After clicking the image you will get black screen instead of the captured image with retake and use photo options. If you select "Use Photo" option you get the correct image in callback.

Note: If you do not set UIModalPresentationStyle for viewController2, the code works fine.

Any idea what is going wrong here.

EDIT: I have used XCODE 5.1 and my target deployment is iOS 7. I am running the app on iOS8 device.

Manoj
  • 1,019
  • 9
  • 17
  • I've got the Same Problem/.. no Answers? What a SHame! – Hernan Arber Oct 18 '14 at 15:59
  • I used XCODE 6 to build my project and and used modalPresentationStyle as UIModalPresentationOverFullScreen on UIImagePickerController to solve this issue. – Manoj Oct 21 '14 at 07:07
  • WorkAround: I created a new UIWindow and added a blankViewController as its root View controller and used that view controller to present the UIImagePickerController in full-screen in iOS7. – Manoj Oct 22 '14 at 05:41

0 Answers0