ios10 相册权限访问

来源:互联网 发布:淘宝天猫自动回复设置 编辑:程序博客网 时间:2024/04/30 00:28

没升级ios之前将图片保存在相册步骤是这样的的:

第一步:

   UIImageWriteToSavedPhotosAlbum(currentView.imageview.image, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);

第二步:

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo;{    if (error) {        label.text = @"保存失败";    }   else {        label.text = @"保存成功";    }}

然而运行时就报错:The app's Info.plist must contain an NSPhotoLibraryUsageDescription key with a string value explaing,这是因为升级ios10之后的产生的一些坑,

解决方案: info.plist 文件添加一个 NSPhotoLibraryUsageDescription的 key,然后添加对应的描述即可。










0 0