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