iOS 8.3 ios9 横屏弹出alertview 崩溃问题


针对错误:

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

提示错误信息:

2015-12-10 10:41:55.442 MobileLesson[9797:3827595] *** Terminating app due to uncaught exception 'UIApplicationInvalidInterfaceOrientation', reason: 'Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES'
*** First throw call stack:
(0x185a5cf48 0x19a60ff80 0x185a5ce90 0x18b06856c 0x18b071b84 0x18b071afc 0x18b0705e4 0x18afeb020 0x18afea350 0x1868fd580 0x18afea1d4 0x18aff7b0c 0x18b43ec7c 0x18b349210 0x18b347328 0x18b2a056c 0x18b2ad4bc 0x18afe1984 0x185a13bd0 0x185a11974 0x185a11da4 0x185940ca0 0x190b7c088 0x18b058ffc 0x1001dda98 0x19ae5e8b8)
libc++abi.dylib: terminating with uncaught exception of type NSException


解决办法,重写UIAlertContrller 的shouldAutorotate 方法,

#import <UIKit/UIKit.h>

@interface UIAlertController (Rotation)
- (BOOL)shouldAutorotate;
@end

#import "UIAlertController+Rotation.h"

@implementation UIAlertController (Rotation)
- (BOOL)shouldAutorotate
{
    return NO;
}
@end


搞定


  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值