1、iOS10相册相机闪退bug:

  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.

  修复方法:

(1)在info.plist文件下添加一下代码:

  相机权限

  <key>NSCameraUsageDescription</key>

  <string>cameraDesciption</string>

  相册权限

  <key>NSPhotoLibraryUsageDescription</key>

  <string>photoLibraryDesciption</string>

在网上还有一个说法,跟上述几乎一样只不过多设置了两项权限:

 (2)你需要在info.plist文件 添加一个“NSContactsUsageDescription ”的Key,Value添加一个描述。需要在应用的info.plist里加入(使用source code模式):

    <key>NSCameraUsageDescription</key>

    <string>cameraDesciption</string>

    <key>NSContactsUsageDescription</key>

    <string>contactsDesciption</string>

    <key>NSMicrophoneUsageDescription</key>

    <string>microphoneDesciption</string>

    <key>NSPhotoLibraryUsageDescription</key>

    <string>photoLibraryDesciption</string>

2、iOS10因苹果健康导致闪退crash

  如果在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就可以l

  请求写入:

  <key>NSHealthUpdateUsageDescription</key>

  <string>some string value stating the reason</string>

  请求读取

 <key>NSHealthShareUsageDescription</key>

<string>some string value stating the reason</string>

另外附加一些其他权限描述:

  相机权限描述:

  <key>NSCameraUsageDescription</key>

   <string>cameraDesciption</string>

  通讯录

  <key>NSContactsUsageDescription</key>

   <string>contactsDesciption</string>

  麦克风

  <key>NSMicrophoneUsageDescription</key>

  <string>microphoneDesciption</string>

  相机

  <key>NSPhotoLibraryUsageDescription</key>

<string>photoLibraryDesciption</string>

3、iOS10配置须知

  在iOS10中,如果你的App想要访问用户的相机、相册、麦克风、通讯录等等权限,都需要进行相关的配置,不然会直接crash。

需要在info.plist中添加App需要的一些设备权限。

  NSBluetoothPeripheralUsageDescription

  访问蓝牙

  NSCalendarsUsageDescription

  访问日历

  NSCameraUsageDescription

  相机

  NSPhotoLibraryUsageDescription

  相册

  NSContactsUsageDescription

  通讯录

  NSLocationAlwaysUsageDescription

  始终访问位置

  NSLocationUsageDescription

  位置

  NSLocationWhenInUseUsageDescription

  在使用期间访问位置

  NSMicrophoneUsageDescription

  麦克风

  NSAppleMusicUsageDescription

  访问媒体资料库

  NSHealthShareUsageDescription

  访问健康分享

  NSHealthUpdateUsageDescription

  访问健康更新

  NSMotionUsageDescription

  访问运动与健身

  NSRemindersUsageDescription

  访问提醒事项

暂时先总结这么多,继续搜集……

针对iOS10的各种问题的解决方法的更多相关文章

  1. 启动tomcat时 一闪而过解决方法

    1 首先确定JAVA 已经配好了环境变量,具体配置方法,找一下度娘. 测试方法:进入cmd -> javac -version 能看到JAVA的版本信息,证明配置成功了. 2 分析一下问题出现的 ...

  2. 针对应用程序池“xxxxxx”的模板永久性缓存初始化失败,解决方法

    日志名称:          Application 来源:            Active Server Pages 日期:            2014-11-22 9:09:39 事件 I ...

  3. 更新xcode后插件失效问题——不针对特定版本的通用解决方法

    一.Xcode更新后插件失效的原理 1.每次更新Xcode后插件都会失效,其实插件都还在这个目录好好的躺着呢: ~/Library/Application Support/Developer/Shar ...

  4. 斯坦福大学公开课机器学习: advice for applying machine learning | deciding what to try next(revisited)(针对高偏差、高方差问题的解决方法以及隐藏层数的选择)

    针对高偏差.高方差问题的解决方法: 1.解决高方差问题的方案:增大训练样本量.缩小特征量.增大lambda值 2.解决高偏差问题的方案:增大特征量.增加多项式特征(比如x1*x2,x1的平方等等).减 ...

  5. 针对piix4_smbus ****host smbus controller not enabled的解决方法

    SMBus 目录 SMBus与I2C的差别 SMBus 是 System Management Bus 的缩写,是1995年由Intel提出的,应用于移动PC和桌面PC系统中的低速率通讯.它主要是希望 ...

  6. Node.js中针对中文的查找和替换无效的解决方法

    Node.js中针对中文的查找和替换无效的解决方法.   //tags的值: tag,测试,帖子 var pos1 = tags.indexOf("测"); //这里返回-1 ta ...

  7. ios10 safari浏览器 在touchmove 里面写e.preventDefault(); 不起作用 的解决方法

    最近做手机端项目遇到一个问题,就是在ios10系统里面  safari浏览器 在touchmove 里面写e.preventDefault();不起作用 更种google 还是没有找到解决方法 最后找 ...

  8. Oracle存储过程中不支持DML语言的解决方法(针对遇见的DROP关键字)

    ---存储过程中的原语句: ---删除表 DROP TABLE A_NEWTDDATA; --报错 经查询:存储过程不支持DML语言: 解决方法: execute immediate 'DROP TA ...

  9. 针对Windows 64位系统中Matlab没有LED Control Activex控件的解决方法

    Win 10 64bits系统中Matlab 64位软件没有LED Control Activex控件,LED ActiveX Control控件位于Gauges Blockset模块中,而Gauge ...

随机推荐

  1. jquery新窗口打开链接

    第一种:下面的代码是针对m35ui这个样式下的a都是在新窗口打开    <script type="text/javascript">  jQuery(document ...

  2. ASP.NET页面生命周期描述

    下面是ASP.NET页面初始的过程:1. Page_Init();2. Load ViewState;3. Load Postback data;4. Page_Load();5. Handle co ...

  3. QQ登录界面

    @property (nonatomic,assign) IBOutlet UITextField *qq; @property (nonatomic,assign) IBOutlet UITextF ...

  4. c_select 调用参数说明

    c_select 调用 1. select系统调用select系统调用是用来让我们的程序监视多个文件描述符的状态变化的.程序会停在select这里等待,直到被监视的文件描述符有某一个或多个发生了状态改 ...

  5. sql求日期

    2.求以下日期SQL: 昨天 select convert(varchar(10),getdate() - 1,120) 明天 select convert(varchar(10),getdate() ...

  6. Lua 垃圾收集机制

    1. 问题:一款用Lua做的游戏,玩了一段时间后会变卡 因为知道lua是有自动管理内存的机制,所以之前一直没有关注过lua内存的问题.所以今天好好的查看了lua垃圾收集机制.看了一下Lua的Garba ...

  7. 学习笔记:GLSL Core Tutorial – Pipeline (OpenGL 3.2 – OpenGL 4.2)

    GLSL Core Tutorial – Pipeline (OpenGL 3.2 – OpenGL 4.2) GLSL 是一种管道,一种图形化的流水线 1.GLSL 的具体工作流程: 简化流程如下: ...

  8. iOS8.0以后的相册

    在 iOS 8.0 后, 使用the Photos framework 代替 the Assets Library framework , The Photos framework 提供更特色和更好的 ...

  9. OVS - commands

    journalctl -t ovs-vswitchd ovs-vsctl show ovs-ofctl show br0 set vlanid ovs-vsctl set port eth0 tag= ...

  10. Loadrunner之文件的下载(八)

    老猪提供: https://mp.weixin.qq.com/s?__biz=MzIwOTMzNDEwNw==&mid=100000013&idx=1&sn=624f5bc74 ...