UIImagePickerController crash in iOS6, iPhone4S

The preferredInterfaceOrientationForPresentation method will rotate your view to whatever you set it to when a view is loaded. Be careful as when you come back to your view it may be upside down. Do not include this method if you don’t want it to override the current orientation when you dismiss say a UIImagePickerController.

UIImagePickerController crash

 Crash:

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

 Add to app delegate:

- (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)w {

return (NSUInteger)[application supportedInterfaceOrientationsForWindow:w] | (1<<UIInterfaceOrientationPortrait);

}

posted on 2013-05-17 04:24  easonoutlook  阅读(409)  评论(0编辑  收藏  举报