info.plist
更新了Xcode8 以及 iOS10,App访问用户的相机、相册、麦克风、通讯录的权限都需要重新进行相关的配置,不然在Xcode8中打开编译的话会直接crash。
需要在info.plist中添加App需要的一些设备权限。
相机NSCameraUsageDescription 相册NSPhotoLibraryUsageDescription 通讯录NSContactsUsageDescription 始终访问位置NSLocationAlwaysUsageDescription 位置NSLocationUsageDescription 在使用期间访问位置NSLocationWhenInUseUsageDescription 麦克风NSMicrophoneUsageDescription 访问蓝牙NSBluetoothPeripheralUsageDescription 访问日历NSCalendarsUsageDescription 访问媒体资料库NSAppleMusicUsageDescription 访问健康分享NSHealthShareUsageDescription 访问健康更新NSHealthUpdateUsageDescription 访问运动与健身NSMotionUsageDescription 访问提醒事项NSRemindersUsageDescription
提别提醒: 从2017年1月1日起,强制使用https,所有新提交的 app 默认不允许使用NSAllowsArbitraryLoads来绕过ATS的限制 安全传输不再支持SSLv3, 建议尽快停用SHA1和3DES算法.
下面贴出来错误:
Q1: iOS10相册相机闪退问题:
iOS10系统下调用系统相册、相机功能,遇到闪退的情况,日志描述如下:
This app has crashed because it attempted to access privacy-sensitive data without a usage description.The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaining to the user how the app uses this data.
解决方法:在info.plist文件下添加
相机权限
<key>NSCameraUsageDescription<key>
<string>cameraDesciption<string>
相册权限
<key>NSPhotoLibraryUsageDescription<key>
<string>photoLibraryDesciption<string>
Q2: iOS 10 因苹果健康导致闪退
如果在app中调用了苹果健康,iOS10中会出现闪退。控制台报出的原因是:Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: 'NSHealthUpdateUsageDescription must be set in the app's Info.plist in order to request write authorization.'
这是因为我们要在info.plist文件中声明苹果健康的使用权限,所以在info.plist中添加以下key就可以:
请求写入
<key>NSHealthUpdateUsageDescription<key>
<string>some string value stating the reason<string>
请求读取
<key>NSHealthShareUsageDescription<key>
<string>some string value stating the reasonPaste_Image.png<string>
Q3: Xcode 打印的那些杂乱无章的bug
更新Xcode8之后,新建立工程,都会打印一堆莫名其妙看不懂的Log.比如如这些
subsystem: com.apple.UIKit, category: HIDEventFiltered, enable_level:0, persist_level:0, default_ttl:0, info_ttl:0, debug_ttl:0, generate_symptoms:0, enable_oversize:1,
屏蔽的方法如下:
Xcode8里边 Edit Scheme->Run-> Arguments, 在Environment Variables里边添加
OS_ACTIVITY_MODE = Disable 就行,截图如下:(真的没有iPhone4了)

弄完之后就可以像之前那样 正常打印了.
info.plist的更多相关文章
- plist文件、NSUserDefault 对文件进行存储的类、json格式解析
========================== 文件操作 ========================== Δ一 .plist文件 .plist文件是一个属性字典数组的一个文件: .plis ...
- Your app declares support for audio in the UIBackgroundModes key in your Info.plist 错误
提交AppStore时候被拒绝 拒绝原因:Your app declares support for audio in the UIBackgroundModes key in your Info.p ...
- ios开发之Info.plist文件相关配置
前言:在iOS开发中有些情况下需要对Info.plist文件进行配置,以下介绍几种相关配置.以后遇到需要配置的再更新... 开发环境:swift3.0.1,Xcode8.1 一,项目中需要使用第三方字 ...
- Excel文件转plist文件出现的文件编码问题
今天在测试时遇到了需要将大量整理好的Excel数据转换为plist文件的情况.百度了一下教程,发现虽然别人也遇到过类似的情况,但是有些讲的还是不够细致.所以做如下整理. 百度到的内容中有使用Mes ...
- 将plist文件读取成为数组
NSString *plistPath = [[NSBundle mainBundle] pathForResource:@"city" ofType:@"plist&q ...
- IOS学习笔记之获取Plist文件读取数据
@property(nonatomic,strong) NSArray *pic; //创建数组属性 @property(nonatomic,assign) int index; //创建索引属性 @ ...
- plist的读取和写入
// 从plist中读取数组数据 let arrPath = Bundle.main.path(forResource: "ArrayPList", ofType: "p ...
- App Transport Security has blocked a cleartext HTTP (http://) resource load since it is insecure. Temporary exceptions can be configured via your app's Info.plist file
ios进行http请求,会出现这个问题: App Transport Security has blocked a cleartext HTTP (http://) resource load sin ...
- iOS plist文件创建
iOS中plist的创建,数据写入与读取功能创建一个test.plist文件,textInput作为输入,displayLabel作为显示,有一个按钮来触发保持程序triggerStorage: -( ...
- 加载plist文件数据的方法
这个pilist文件最外面的是一个数组,数组中每一个item是一个字典,我们的目的就是为了取到每一个item字典中的内容数据 下面看代码举例 //加载数组 - (void)handleData { / ...
随机推荐
- Make a DAC with a microcontroller's PWM timer
http://www.edn.com/design/analog/4337128/Make-a-DAC-with-a-microcontroller-s-PWM-timer Many embedded ...
- vim 之cscope的使用
http://www.mcuos.com/thread-8488-1-1.html http://blog.csdn.net/longerzone/article/details/7789581 ht ...
- 用最简单的例子理解适配器模式(Adapter Pattern)
中国足球的水平虽然不高,但实际上,在每个城市会有一批足球爱好者,他们踢球.看球.懂球.有这样的2个足球爱好者,一个是左脚选手,另一个是右脚选手. public class PlayWithLeft { ...
- 22LINQ查询运算符返回IEnumerable<T>实例汇总
本篇体验LINQ的各种查询运算符. 先创建一个泛型方法,用来显示查询结果: private static void DisplayQuery<T>(IEnumerable<T&g ...
- 使用命名参数处理 CallableStatement
简介:JDBC 中的语句处理 在 JDBC 应用程序中,JDBC 语句对象用于将 SQL 语句发送到数据库服务器.一个语句对象与一个连接相关联,应用程序与数据库服务器之间的通信由语句对象来处理. JD ...
- 关于JSONP以及跨域相关
什么是跨域: 浏览器对ajax请求的限制,不允许跨域请求资源. http://www.a.com--->http://www.b.com 是跨域 http://www.a.com-- ...
- 启动Memcached报错:/usr/local/memcached/bin/memcached: error while loading shared libraries: libevent-2.1.so.6: cannot open shared object file: No such file or directory
1.查找文件放在哪里 sudo find / -name libevent-2.1.so.6 发现放在/usr/local/lib/libevent-2.1.so.6下. 2.创建软链接 sudo l ...
- ELK kibana查询与过滤
在kibana中,可通过搜索查询过滤事务或者在visualization界面点击元素过滤. 创建查询 在Discover界面的搜索栏输入要查询的字段.查询语法是基于Lucene的查询语法.允许布尔运算 ...
- mybatis查询时间段sql语句
转载自:http://blog.csdn.net/zl544434558/article/details/24428307?utm_source=tuicool&utm_medium=refe ...
- parameter server学习
关于parameter server的学习: https://www.zybuluo.com/Dounm/note/517675 机器学习系统相比于其他系统而言,有一些自己的独特特点.例如: 迭代性: ...