This app has crashed because it attempted to access privacy-sensitive data without a usage descripti

运行环境

    XCode 8.2.1

问题描述

    当调取相册的时候APP崩溃并显示标题的错误: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.
This app has crashed because it attempted to access privacy-sensitive data without a usage descripti_第1张图片

问题分析

    iOS进入10时代之后在Info.plist需要加入NSPhotoLibraryUsageDesciption这个key,value值是一个string值用来描述APP将如何描述这个数据将如何使用。

解决方案

    在Info.plist文件中加入NSPhotoLibraryUsageDesciption即可。
这里写图片描述
This app has crashed because it attempted to access privacy-sensitive data without a usage descripti_第2张图片

你可能感兴趣的:(iOS)