报错提示
[access] 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.
错误原因
- 意思是这个App缺少一个获取私有(敏感)数据的权限描述,需要我们在info.plist文件中必须含有一个名字叫做NSPhotoLibraryUsageDescription的值来解释为什么应用需要使用这个数据,
解决
- 在info.plist文件中添加相册资源的键值:NSPhotoLibraryUsageDescription
-
就弹出了一个获取权限的问候,点击获取图片资源,不会发生崩溃了:
网友评论