ios6.0, the program is horizontal screen, there is a flash back

Source: Internet
Author: User

This article reprint to http://blog.csdn.net/huanghuanghbc/article/details/10150355 ios6.0, the program is horizontal screen, appear flash back
Terminating app due to uncaught exception ' uiapplicationinvalidinterfaceorientation ', Reason: ' Supported Orientations have no common orientation with the application, and Shouldautorotate are returning YES '
First throw Call stack:
(0x1c8d012 0x10cae7e 0x1c8cdeb 0xff702 0xff72e 0xffd6d 0xf6caf 0x108790 0x5f25e 0x5f05d 0x5f05d 0x5a5e6 0x60af4 0x58eed 0x 4dfc4b 0x29f0 0x10de705 0x15920 0x158b8 0xd6671 0xd6bcf 0xd5d38 0x4533f 0x45552 0x233aa 0x14cf8 0x1be8df9 0x1be8ad0 0X1C02 Bf5 0x1c02962 0x1c33bb6 0x1c32f44 0x1c32e1b 0x1be77e3 0x1be7668 0x1265c 0x21bd 0x20e5)
Libc++abi.dylib:terminate called throwing an exception himself to find the answer;
is because the Uiimagepickercontroller is vertical screen, and the ipad is a horizontal screen, in the ios6.0 screen of the problem is more sensitive, so in will hang.
Workaround:
In supported Interface orientations select Landscapeleft and Landscaperight (if unchecked, the first time you run a vertical screen under iOS5.0)
Add in Appdelegate
#if __ipad_os_version_max_allowed >= __ipad_6_0

-(Nsuinteger) Application: (UIApplication *) application Supportedinterfaceorientationsforwindow: (UIWindow *) window
{

return uiinterfaceorientationmaskall;


}
#endif
Added in the Viewcontroller and the viewcontroller of the previous layer
-(BOOL) Shouldautorotatetointerfaceorientation: (uiinterfaceorientation) interfaceorientation
{

return (interfaceorientation = = Uiinterfaceorientationlandscapeleft | | interfaceorientation = = Uiinterfaceorientationlandscaperight);

}

-(Nsuinteger) supportedinterfaceorientations{
return uiinterfaceorientationmasklandscape;
}

-(BOOL) shouldautorotate
{
return YES;
}

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.