升级了iOS10和xcode8,发现访问相机、相册、麦克风、蓝牙、日历等时会出现闪退,控制台给出这样的信息:web
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.
根据提示须要在plist中加入NSCameraUsageDescription
一般须要添加以下权限说明(相机、通信录、麦克风、相册):xcode
Key:NSCameraUsageDescription Type:String Value:cameraDesciption
Key:NSContactsUsageDescription Type:String Value:contactsDesciption
Key:NSMicrophoneUsageDescription Type:String Value:microphoneDesciption
Key:NSPhotoLibraryUsageDescription Type:String Value:photoLibraryDesciption