问题:手机系统升级至iOS10之后,iPhone6在使用相册以及相机时出现崩溃,断点打印出如下错误
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文件并且在Information Property List中添加 NSPhotoLibraryUsageDescription
2.选择字符串属性,并且添加描述,描述根据需求来写(主要是起到一个提示的作用)
3.保存Clean一下重新运行即可
一下为一些常用Key
使用相机崩溃需要添加 NSCameraUsageDescription
使用通讯录崩溃需要添加NSContactsUsageDescription
使用麦克风崩溃需要添加NSMicrophoneUsageDescription
不要忘记添加描述!