美文网首页iOS
Terminating app due to uncaught

Terminating app due to uncaught

作者: survivorsfyh | 来源:发表于2020-09-15 10:06 被阅读0次

    iPad 端开发的时候禁止了竖屏模式,后期版本迭代的时候新增了拍照采集的功能,随后一切准备就绪调试的途中遇到了如下异常:

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

    解决办法

    若程序仅支持横屏可以尝试如下方式,在 AppDelegate 中添加如下 code 即可;

    #if __IPHONE_OS_VERSION_MAX_ALLOWED >= __IPHONE_6_0 
    
    - (NSUInteger)application:(UIApplication *)application supportedInterfaceOrientationsForWindow:(UIWindow *)window {
        return UIInterfaceOrientationMaskAll;
    }
    
    #endif
    

    以上便是此次分享的全部内容,希望能对大家有所帮助!

    相关文章

      网友评论

        本文标题:Terminating app due to uncaught

        本文链接:https://www.haomeiwen.com/subject/ytbxyktx.html