ios10 相册权限访问

没升级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,然后添加对应的描述即可。










猜你喜欢

转载自blog.csdn.net/JSON_6/article/details/53080938
今日推荐