iOS10 权限崩溃问题

每日更新关注:http://weibo.com/hanjunqiang 
新浪微博!

今天 手机升级了 iOS10 Beta,然后用正在开发的项目 装了个ipa包,发现点击有关 权限访问 直接Crash了,并在控制台输出了一些信息:

This app has crashed because it attempted to access privacy-sensitive data without a usage description.  The app's Info.plist must contain an NSContactsUsageDescription key with a string value explaining
to the user how the app uses this data.

意思是说:你需要在info.plist文件 添加一个“NSContactsUsageDescription ”的Key,Value添加一个描述。

1,在项目中找到info.plist文件,右击有个 Open As,以Source Code 的形式打开

2,分别复制 以下 Value 和Key,Key 一定不能错,Value 貌似可以随便填写

相机权限描述:

<key>NSCameraUsageDescription</key>

    <string>cameraDesciption</string>

通信录:

    <key>NSContactsUsageDescription</key>

    <string>contactsDesciption</string>

麦克风:

    <key>NSMicrophoneUsageDescription</key>

    <string>microphoneDesciption</string>

相机:

    <key>NSPhotoLibraryUsageDescription</key>

    <string>photoLibraryDesciption</string>

eg:其他权限描述,debug 控制台都会有输出的,自行添加就OK

每日更新关注:http://weibo.com/hanjunqiang 
新浪微博!

3,在info.plist 文件上 复制上,然后 保存,如下图:

Source Code 的形式:

Property List 的展现形式:

4,Clean之后,运行就OK了

每日更新关注:http://weibo.com/hanjunqiang 
新浪微博!

最新文章

  1. FastDFS 上传文件
  2. javascript js表示中文日期的经典写法
  3. hdu 3804 树链剖分
  4. iBeacon 开发笔记
  5. 九度OJ 1124 Digital Roots -- 数位拆解
  6. Spring-----Spring整合Struts2实例
  7. 虚拟机Linux 的一些基础命令和注释
  8. yum 安装rabbitMQ
  9. 洗礼灵魂,修炼python(5)--python操作符,内置函数
  10. Windows安装zookeeper 单机版
  11. numpy 库使用
  12. python的bit_length方法
  13. BootStrap布局组件
  14. excel导入数据库实例(含源码 超级详细适合新手)
  15. hbase 分页过滤(新老API的差别)
  16. shell实战之case语句的选择提示
  17. MongoDB入门---文档操作之增删改
  18. iTunes备份路径,iTunes默认备份路径,iTunes修改备份路径
  19. 条款36:绝对不要重新定义,继承而来的non-virtual函数
  20. CTS/APIO后文化课游记

热门文章

  1. bzoj4011[HNOI2015]落忆枫音 dp+容斥(?)
  2. SQL Server 2008作业失败无法确定所有者是否有服务器访问权限
  3. 操作系统中的几种调度算法(JAVA版)
  4. Mysql锁机制--索引失效导致行锁变表锁
  5. 8.1 使用Python操作SQLite数据库
  6. Codeforces Round #396(Div. 2) A. Mahmoud and Longest Uncommon Subsequence
  7. python复杂网络库networkx:绘图draw
  8. C++用LuaIntf调用Lua代码示例
  9. 一小时入门PHP
  10. 让你的代码量减少3倍!使用kotlin开发Android(三) 缩短五倍的Java Bean