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. Stm32 Bootloader整理

    Stm32 Bootloader整理 一.        基本概念 1.IAP IAP是In Application Programming的首字母缩写,IAP是用户自己的程序在运行过程中对User ...

  2. SCP测试服务器的上行/下行带宽

    SCP测试服务器的上行/下行带宽,这个咋弄呢?有时间再研究一下.

  3. 【bfs】 poj 3984 maze 队列存储

    #include <iostream> #include <stdio.h> #include <cstring> #define Max 0x7f7f7f7f u ...

  4. MVVM的架构设计与团队协作 with StoryBoard

    今天写这篇博客是想达到抛砖引玉的作用,想与大家交流一下思想,相互学习,博文中有不足之处还望大家批评指正.本篇博客的内容沿袭以往博客的风格,也是以干货为主,偶尔扯扯咸蛋(哈哈~不好好工作又开始发表博客啦 ...

  5. ReactiveCocoa的冷信号与热信号 探讨

    背景 ReactiveCocoa(简称RAC)是最初由GitHub团队开发的一套基于Cocoa的FRP框架.FRP即Functional Reactive Programming(函数式响应式编程), ...

  6. java 数组流

    Example10_10.java import java.io.*; public class Example10_10 { public static void main(String args[ ...

  7. “找回” Envi 快捷方式

      Envi+IDL文件夹挪到别的电脑,不用安装,直接可以使用.但是桌面和开始菜单没有了Envi,IDL,envi+idl的快捷方式,很不方便.   记录一下快捷方式命令行,备用: envi快捷方式 ...

  8. 转:Selenium2.0介绍——WebDriver两种驱动浏览器的方式.

    如果之前熟悉Selenium RC,理解了Selenium RC是如何工作的,那么,当第一次接触Selenium WebDriver的时候,看到WebDriver居然可以不需要指定远端服务器的IP地址 ...

  9. 强制性输出private中变量的三种方法

    众所周知,private里面的变量不可以输出,但是也可以通过特殊途径获得. 1.通过指针暴力内存,把它索罗出来,方法:调试,破掉语法. 并且还可以对类对象进行修改. // Thread.cpp : 定 ...

  10. springmvc传递json数据到前台显示

    需要两个包 jackson-core-asl, jackson-mapper-asl controller @RequestMapping(value="/findEduList" ...