UIAlertController:supportedInterfaceOrientations was invoked recursively
来源:互联网 发布:海尔cosmo平台 知乎 编辑:程序博客网 时间:2024/06/10 21:19
在使用UIAlertController *sheet = [UIAlertController alertControllerWithTitle:nil message:nil preferredStyle:(UIAlertControllerStyleActionSheet)];时候,
或者使用UIActionSheet *sheet = [[UIActionSheet alloc] initWithTitle:nil delegate:self cancelButtonTitle:@"取消" destructiveButtonTitle:nil otherButtonTitles:@"从相册中选取",@"拍照", nil];
时候,会有奔溃:
UIAlertController:supportedInterfaceOrientations was invoked recursively!
然后我给的解决方案是:
建分类,添加分类方法,避免递归调用。
#import <UIKit/UIKit.h>
@interface UIAlertController (supportedInterfaceOrientations)
@end
#import "UIAlertController+supportedInterfaceOrientations.h"
@implementation UIAlertController (supportedInterfaceOrientations)
#if __IPHONE_OS_VERSION_MAX_ALLOWED < 90000
- (NSUInteger)supportedInterfaceOrientations{
return UIInterfaceOrientationMaskPortrait;
}
#else
- (UIInterfaceOrientationMask)supportedInterfaceOrientations {
return UIInterfaceOrientationMaskPortrait;
}
#endif
@end
- UIAlertController:supportedInterfaceOrientations was invoked recursively
- UIAlertController:supportedInterfaceOrientations was invoked recursively
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIalertController
- UIAlertController
- UIalertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- UIAlertController
- 卸载Office之后无法打开rtx
- 【POJ 1095】Trees Made to Order(卡特兰+递归)
- TweenAnimation、布间动画、和炸月球小项目
- (java题目第3讲)ACM(http://blog.csdn.net/kuhuaishuxia/article/details/52254209)
- OC-XIB使用&UITextField
- UIAlertController:supportedInterfaceOrientations was invoked recursively
- 设计模式之迭代器模式---以JDK源码为例
- Android 6.0 AMS分析的第二条线:以Launcher启动一个Activity为例,分析应用进程的创建、Activity的启动,以及他们和AMS之间的交互等知识;
- linux下各种小命令
- LeetCode-ZigZag Conversion
- Unity3D —— Socket通信(C#)
- Linux分页机制之分页机制的演变--Linux内存管理(七)
- Android下bluedroid、bluetooth apk介绍
- 深度卷积神经网络.cnn权值网络与cnn权值矩阵的创新思路