控制台输出This app has crashed becaus
2016-10-21 本文已影响0人
Billy_W
升级xcode 8 以后在iOS 10运行程序出奔溃
控制台出现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 文件添加一个NSPhotoLibraryUsageDescription的 key,然后添加一个描述。
找到项目中info.plist文件,在其中添加
<key>NSBluetoothPeripheralUsageDescription</key>
<string>蓝牙权限</string>
<key>NSCameraUsageDescription</key>
<string>使用相机权限</string>
<key>NSMicrophoneUsageDescription</key>
<string>使用麦克风权限</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>使用相册权限</string>
以上<key>注意不能写错,而<string>则为描述
这是利用Source Code形式打开的info.plist 文件,也可以使用info.plist 文件中的“+”进行添加key值。