【发布时间】:2016-02-19 08:56:26
【问题描述】:
目前我正在使用 UIImageWriteToSavedPhotosAlbum 通过点击特定按钮从特定网址保存图像。图片保存成功。
现在,稍后我想通过点击相机胶卷相册 iOS 中的相同按钮来检索相同的图像。我不想再次调用图像的 url。
如何使用 Objective-C 实现这一结果?
[[SDWebImageDownloader sharedDownloader] downloadImageWithURL:url
options:0
progress:^(NSInteger receivedSize, NSInteger expectedSize) {
}
completed:^(UIImage *image, NSData *data, NSError *error, BOOL finished) {
if (image && finished) {
UIImageWriteToSavedPhotosAlbum(image,self,
@selector(image:didFinishSavingWithError:contextInfo:),
nil);
}
}];
【问题讨论】:
-
你能发布你的代码吗?
-
改用 ALAssestLibrary 方法,您将拥有更多控制权。
-
@elio.d - 但是当前版本的 iOS 已弃用此库。
-
@RohitaxRajguru 不推荐使用并不意味着您不能使用它。无论如何,使用作为替代品的 PhotoFramework。
-
@KamleshShinarakhiya:添加了上面的代码。
标签: ios objective-c iphone xcode