iOS 设置横屏导致崩溃!

0x00

*** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'preferredInterfaceOrientationForPresentation 'landscapeLeft' must match a supported interface orientation: 'portrait, landscapeRight'!'


0x01

所支持的方向是一个集合
当前设备方向
应该是集合中的一个值

/// 当前方向
- (UIInterfaceOrientation)preferredInterfaceOrientationForPresentation
{
    if (hengping) {
        return UIInterfaceOrientationLandscapeRight;
    }else{
        return UIInterfaceOrientationPortrait;
    }
}

/// 所支持的方向
- (UIInterfaceOrientationMask)supportedInterfaceOrientations
{
    return UIInterfaceOrientationMaskPortrait | UIInterfaceOrientationMaskLandscapeRight;
}

画线,画虚线,画五角星,画矩形,画虚线矩形,渐变色

https://github.com/xjh093/JHDraw


你可能感兴趣的:(iOS各种报错)