Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES
某一个页面横屏时会出现崩溃的问题描述,原因是当你在AppDelegate中返回的设备方向是UIInterfaceOrientationMaskLandscapeLeft.但是你在视图控制器中返回支持自动旋转。就会抛出此异常。
解决方法 重写UIAlertContrller 的shouldAutorotate 方法,
#import <UIKit/UIKit.h> @interface UIAlertController (Rotation)
- (BOOL)shouldAutorotate;
@end #import "UIAlertController+Rotation.h" @implementation UIAlertController (Rotation)
- (BOOL)shouldAutorotate
{
return NO;
}
@end
即可
by:初光夫
Supported orientations has no common orientation with the application, and [UIAlertController shouldAutorotate] is returning YES的更多相关文章
- iOS Error
1),'libxml/tree.h' file not found Solution: 1. 导入libxml2.dylib 包 2.设置Header Search Paths 为 /usr/inc ...
- iOS Xcode Error 集锦
一),'libxml/tree.h' file not found Solution: 1. 导入libxml2.dylib 包 2.设置Header Search Paths 为 /usr/inc ...
- IOS 调用系统照相机和相册
/** * 调用照相机 */ - (void)openCamera { UIImagePickerController *picker = [[UIImagePickerController all ...
- 【Xamarin挖墙脚系列:IOS-关于手机支持的屏幕方向】
原文:[Xamarin挖墙脚系列:IOS-关于手机支持的屏幕方向] 设置支持的屏幕方向有两个级别,一个是app级别的,另一个是viewController级别的. app 级别的可以在[target] ...
- quick-cocos2d 设置横屏
quick cocos2d新建项目,在xcode中 起模拟器,默认的是竖屏,我想做一个横屏的游戏,前面已经说了 选中你的项目,在General这个标签内,Deoployment info的这个分组,有 ...
- Crash以及报错总结
CoreData: Cannot load NSManagedObjectModel.nil is an illegal URL parameter 这是因为在工程中CoreData的命名和AppDe ...
- iOS----闪退,无报错原因,经典解决方案
在iOS开发时,有时候遇到libc++abi.dylib handler threw exception这样的异常, 虽然在断点出加上了All Exceptions,也断到相应的代码了,但是没打印对 ...
- ios6.0,程序为横屏,出现闪退
本文转载至 http://blog.csdn.net/huanghuanghbc/article/details/10150355 ios6.0,程序为横屏,出现闪退 *** Terminatin ...
- 银联手机支付控件官方使用指南(ios版)
目录 版本信息... 2 目录 3 1 概述... 1 2 支付流程介绍... 1 3 测试帐号... 2 4 iOS客户端... 3 4.1 ...
随机推荐
- prometheus 监控ElasticSearch核心指标
ES监控方案 本文主要讲述使用 Prometheus监控ES,梳理核心监控指标并构建 Dashboard ,当集群有异常或者节点发生故障时,可以根据性能图表以高效率的方式进行问题诊断,再对核心指标筛选 ...
- jquery验证时间
http://blog.csdn.net/guguojin/article/details/7045908 验证时间的正则表达式集合 //日期格式yyyy PatternsDict.date_y= ...
- jQuery网页加载的不同方式
一.window.onload 代码是从上而下执行的,通过window.onload可以使事件在页面加载完毕再执行 注意:window.onload事件多个只会执行最下面的一个,前面的会被覆盖 < ...
- Bzoj 2301: [HAOI2011]Problem b(莫比乌斯反演+除法分块)
2301: [HAOI2011]Problem b Time Limit: 50 Sec Memory Limit: 256 MB Description 对于给出的n个询问,每次求有多少个数对(x, ...
- 20175234 2018-2019-2 实验四 Android程序设计
目录 20175234 2018-2019-2 实验四 Android程序设计 任务一 任务二 任务三 任务四 任务五 问题及解决措施 码云链接 参考资料 20175234 2018-2019-2 实 ...
- oracle查询表指定字段类型
查询表某字段类型,如下: SELECT data_type FROM all_tab_cols WHERE table_name = UPPER('SRIS_P_BaseInfo') and colu ...
- Elasticsearch6.4.0-windows环境部署安装
Elasticsearch可以轻松的实现全文检索,本文主要介绍Elasticsearch(ES)环境的安装部署,该文及后续使用的ES版本为6.4.0.希望能够帮助到大家. 一.安装Elasticsea ...
- python代码-leetcode1 两数相加
1.两个循环 class Solution: def twoSum(self, nums, target): n=len(nums) for i in range(n): for j in range ...
- linux ubuntu 如何解决warning: no newline at end of file?
今天写了一段代码, 是在Windows下编辑的, 保存后放在linux系统下编译. gcc和cc都产生以下的警告: a.h:1:2: warning: no newline at end of fil ...
- 006-多线程-集合-Set-ConcurrentSkipListSet
一.简介 ConcurrentSkipListSet是线程安全的有序的集合,适用于高并发的场景.ConcurrentSkipListSet和TreeSet,它们虽然都是有序的集合.但是,第一,它们的线 ...