相关疑难解决方法(0)

preferredInterfaceOrientationForPresentation必须返回支持的接口方向

此错误没有意义,因为UIInterfaceOrientationLandscapeRight支持的方向返回首选方向

//iOS6

-(BOOL)shouldAutorotate
{
    return NO;
}

-(NSUInteger)supportedInterfaceOrientations
{
    return (UIInterfaceOrientationLandscapeRight | UIInterfaceOrientationLandscapeLeft);
}

- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    return UIInterfaceOrientationLandscapeRight;
}
Run Code Online (Sandbox Code Playgroud)

错误:

由于未捕获的异常'UIApplicationInvalidInterfaceOrientation'而终止应用程序,原因是:'preferredInterfaceOrientationForPresentation必须返回支持的接口方向!'

cocoa ios ios6

30
推荐指数
3
解决办法
4万
查看次数

标签 统计

cocoa ×1

ios ×1

ios6 ×1