iOS11保存图片到本地的相册权限问题
2017-09-30 本文已影响3195人
打瞌睡de小男孩
今天xcode9调试保存图片到本地发现一直崩溃 ,而我确认plist文件是添加了访问相册权限的,后来看打印错误信息
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.
一开始还没注意 ,ios11之前的相册权限是
Privacy - Photo Library Usage Description
但是现在的提示是
NSPhotoLibraryAddUsageDescription
后来查资料发现原来ios11新增加了一个权限就是这个只能写入(write- only)的权限

所以有需要保存图片到本地的功能,还需要再新增一个添加图片的权限,添加方法和之前相同,添加之后就正常操作了
Privacy - Photo Library Additions Usage Description