iOS10相机等崩溃

当使用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 NSCameraUsageDescription key with a string value explaining to the user how the app uses this data.

有如下常用字段
  • NSContactsUsageDescription -> 通讯录

  • NSMicrophoneUsageDescription -> 麦克风

  • NSPhotoLibraryUsageDescription -> 相册

  • NSCameraUsageDescription -> 相机

  • NSLocationAlwaysUsageDescription -> 地理位置

  • NSLocationWhenInUseUsageDescription -> 地理位置

我们需要在info.plist中设置提醒,在iOS10之前默认就给设置了

<key>NSCameraUsageDescription</key>    
<string>cameraDesciption</string>
<key>NSContactsUsageDescription</key>
<string>contactsDesciption</string>
<key>NSMicrophoneUsageDescription</key>
<string>microphoneDesciption</string>
<key>NSPhotoLibraryUsageDescription</key>
<string>photoLibraryDesciption</string>
posted @ 2016-11-16 15:36  秋棠枫眠  阅读(363)  评论(0编辑  收藏  举报