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 { / ...
随机推荐
- cloc 统计代码行数工具
cloc 统计代码行数工具 官网地址:http://cloc.sourceforge.net/ 下载完成后 会生成一个.exe文件 需要修改文件名为 cloc.exe 然后把这个文件拷贝到需要统计的根 ...
- Get started with IDA and disassembly SH7058
http://www.romraider.com/forum/viewtopic.php?f=25&t=6303 All of the 16-bit guidance in the follo ...
- IDA Supported Processors
IDA supports more than 50 families of processors. The source code of some of the processor modules i ...
- 使用Bootstrap 3开发响应式网站实践07,页脚
页脚部分比较简单,把一个12列的Grid切分. <footer> <div class="container"> <div class="r ...
- error launching remote program failed to get the task for process
Error Starting executable: error launching remote program failed to get the task for process 715 这个 ...
- SQL 条件 判断 select case as
" then "返回的数据1" " then "返回的数据2" else "返回的其他数据" end as 新的列名 f ...
- Windows X64汇编入门(1)
最近断断续续接触了些64位汇编的知识,这里小结一下,一是阶段学习的回顾,二是希望对64位汇编新手有所帮助.我也是刚接触这方面知识,文中肯定有错误之处,大家多指正.文章的标题包含了本文的四方面主要内容: ...
- iframe在ie和firefox中的高度兼容性问题解决
1.问题描述: <iframe src="p_photo_cont_iframe.html" name="iframe" width="700& ...
- dwz tabs table实现翻页及各tabs查询
效果如图:
- C++运算符重载(成员函数方式)
一.运算符重载 C++中预定义的运算符的操作对象只能是基本数据类型,实际上,对于很多用户自定义类型,也需要有类似的运算操作.如果将C++中这些现存的运算符直接作用于用户自定义的类型数据上,会得到什么样 ...