更新Xcode 8.1之后,运行模拟机的时候崩溃,控制台给我一串信息:
[access] 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里边需要
1、在Info.plist 中添加NSCameraUsageDescription 类型 string。
2、后边的描述可以随意写。
或者
1.在项目中找到info.plist文件,右键点击以 Source Code形式打开
2.添加以下键值对,这里以 PhotoLibrary 作为例子

1-1.png
// 相机
<key>NSCameraUsageDescription</key> <string>cameraDesciption</string>
// 照片
<key>NSPhotoLibraryUsageDescription</key<string>photoLibraryDesciption</string>
// 通讯录
<key>NSContactsUsageDescription</key> <string>contactsDesciption</string>
// 麦克风
<key>NSMicrophoneUsageDescription</key> <string>microphoneDesciption</string>