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文件下添加
這是因為iOS對用戶的安全和隱私的增強,在申請很多私有權限的時候都需要添加描述,但是,在使用Xcode 8之前的Xcode還是使用系統的權限通知框.
要想解決這個問題,只需要在info.plist添加NSContactsUsageDescription的key, value自己隨意填寫就可以,這里列舉出對應的key(Source Code模式下):
<key>NSCameraUsageDescription</key>
<string>cameraDesciption</string>
<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>
<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>