iOS 10调用相册权限设置crash问题

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文件 添加一个“NSContactsUsageDescription ”的Key,Value添加一个描述。

1,在项目中找到info.plist文件,右击有个 Open As,以Source Code 的形式打开
2,分别复制 以下 Value 和Key,Key 一定不能错,Value 貌似可以随便填写

相机权限描述:

    <key>NSCameraUsageDescriptionkey>
    <string>cameraDesciptionstring>

通信录:

  <key>NSContactsUsageDescriptionkey>
    <string>contactsDesciptionstring>

麦克风:

 <key>NSMicrophoneUsageDescriptionkey>
    <string>microphoneDesciptionstring>

相册:

    <key>NSPhotoLibraryUsageDescriptionkey>
    <string>photoLibraryDesciptionstring>

你可能感兴趣的:(iOS-开发)