项目将图片并保存到本地的功能,一点发现闪退了。
发现 Xcode 报以下错误:
This app has crashed because it attempted to access privacy-sensitive data without a usage description. The app's Info.plist must contain an NSPhotoLibraryAddUsageDescription key with a string value explaining to the user how the app uses this data.
调用相机一样, Info.plist 里面要涉及隐私数据时要添加一句“提示语”。于是打开 Info.plist,点击 + 号,在 Key 中输入:Privacy - Photo Library Additions Usage Description,Type 选择 String,Value 中输入你的提示语。
重新编译运行,OK!