0

I managed to push an ABNewPersonViewController to my navigation controller. However I encountered this error when I'm selecting "Add photo" -> "Choose Photo":

* Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and shouldAutorotate is returning YES'

This error is caused to due the fact that I want my iPad application to have landscape-only orientation.

Any idea how to solve this problem ? Many thanks !

kevin.ng
  • 67
  • 7

1 Answers1

0

Hope this helps anyone who has problem with this:

@ App Delegate, add this line of code

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window{
return UIInterfaceOrientationMaskAll;

}

@ Your view, add this line of code

- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskLandscape;

}

This will make Photo selector view thinks that it has UIInterfaceOrientationMaskPortrait, and yet the application still remains as landscape! Voila!

kevin.ng
  • 67
  • 7