• 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);

    }

  • 相关阅读:
    Go语言专题
    计算机网络专题
    分布式系统理论专题
    Scala语言专题
    Zookeeper专题
    Java虚拟机专题
    Java并发编程专题
    git使用指南
    Oracle查询今天、昨天、本周、上周、本月、上月数据
    python3 装饰器
  • 原文地址:https://www.cnblogs.com/easonoutlook/p/3083026.html
Copyright © 2020-2023  润新知