决解IOS10 权限问题带来的报错
2016-09-26 本文已影响0人
Lsx_f
今天把手机升级到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文件 添加一个“NSContactsUsageDescription”的Key,Value添加一个描述。
1,在项目中找到info.plist文件,右击有个 Open As,以Source Code 的形式打开
2,分别复制 以下 Value 和Key,Key 一定不能错,Value 貌似可以随便填写

3,在info.plist 文件上 复制上,然后 保存,如下图:
Source Code 的形式:

Property List 的展现形式:

4,Clean之后,运行就OK了