My application is Landscape
based. The app crashes immediately when the app runs on my device.
I have selected these two fields
UIInterfaceOrientationLandscapeLeft
UIInterfaceOrientationLandscapeRight
I am getting this error:
Terminating app due to uncaught exception UIApplicationInvalidInterfaceOrientation, reason: Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES
Add shouldAutorotate and supportedInterfaceOrientations methods to your controller.
You should use UIInterfaceOrientationMaskLandscape instead of UIInterfaceOrientationLandscapeLeft & UIInterfaceOrientationLandscapeRight. In iOS SDK 6.0+, new enum(UIInterfaceOrientationMask) is used for returning supported orientations.
shouldAutorotateToInterfaceOrientation return only those with you want to support
please check one more thing, the connection between the
File's Owner and View
, if the view will not attach with the file's Owner It will crash.