Impossible to run image picker or camera in landscape mode?
Impossible to run image picker or camera in landscape mode?
- Subject: Impossible to run image picker or camera in landscape mode?
- From: Carl Hoefs <email@hidden>
- Date: Tue, 14 Oct 2014 12:54:25 -0700
Xcode 6.0.1, iOS 7
My iOS app is landscape-only. When I try to bring up the camera image picker:
[self presentViewController:self.imagePickerController animated:YES completion:nil];
I get the following error:
*** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES’
I have “Landscape Left” and “Landscape Right” selected for the app orientations in Xcode. Additionally I have these in the root view controller:
- (BOOL)shouldAutorotate {
return NO;
}
- (NSUInteger)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskLandscapeLeft | UIInterfaceOrientationMaskLandscapeRight;
}
- (IBAction) showImagePickerForCamera:(id)sender {
[self showImagePickerForSourceType:UIImagePickerControllerSourceTypeCamera];
}
The error goes away if I select Portrait orientation mode in Xcode, but then the camera interface is presented in portrait mode. How can I run the photo image picker or camera in landscape mode?
-Carl
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden