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 { / ...
随机推荐
- 回顾下$.ajax()方法参数
1.url: 要求为String类型的参数,(默认为当前页地址)发送请求的地址. 2.type: 要求为String类型的参数,请求方式(post或get)默认为get.注意其他http请求方法,例如 ...
- empireCMS 帝国cms功能总结
上1 系统 对应左菜单为 系统设置 系统参数设置 基本属性 站点名称,网站地址,关键字,简介,首页模式,php时间, 前台功能,操作时间,来源地址,验证码 用户属性 后台验证码开启,次数限制,时间限制 ...
- 《C预处理》Linux内核中可变参数宏的用法
http://blog.csdn.net/tankai19880619/article/details/12015305
- Apple Developer Registration and DUNS Number Not Accepted
Now that I have my Mac and app source code. I’m ready to start working on my first app. The next ste ...
- 用最简单的例子理解对象为Null模式(Null Object Pattern)
所谓的"对象为Null模式",就是要求开发者考虑对象为Null的情况,并设计出在这种情况下的应对方法. 拿"用最简单的例子理解策略模式(Strategy Pattern) ...
- MVC实现多选下拉框,保存并显示多选项
在"MVC实现多选下拉框"中,主要是多选下拉框的显示,而实际情况通常是:选择多个选项提交后,需要在编辑页把所有选中的项显示出来. 模拟这样的一个场景:一个车迷可能有多个自己喜欢的汽 ...
- Extjs GridPanel 监听事件 行选中背景
Extjs设置GridPanel选中行背景色和选中单元格背景色 var view = grid.getView(); view.getRow(index).style.backgroundColor ...
- [runtime] iOS-Runtime-Headers
Dynamically Generated iOS Headers https://github.com/nst/iOS-Runtime-Headers Here are iOS Objective- ...
- Linux文件实时同步,可实现一对多
说明:该功能服务端安装sersync2,客户端安装rsync,原理就是服务端主动推送设定目录下的所有更新的文件到各个客户端rsync接收. rsync大家都知道,是Linux自带的数据同步工具,而se ...
- Python爬虫之selenium爬虫,模拟浏览器爬取天猫信息
由于工作需要,需要提取到天猫400个指定商品页面中指定的信息,于是有了这个爬虫.这是一个使用 selenium 爬取天猫商品信息的爬虫,虽然功能单一,但是也算是 selenium 爬虫的基本用法了. ...