IOS保存图片到本地
2014-07-04 11:41
369 查看
转载自:http://blog.csdn.net/hengshujiyi/article/details/22879495
NSString *data = [arguments objectAtIndex0];
UIImage *image = [UIImage imageWithData:[GTMBase64 decodeString:data]];
// UIImageWriteToSavedPhotosAlbum(image, nil,nil,nil);
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
[SVProgressHUD show];
// 指定回调方法
- (void)image: (UIImage *) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo{
[SVProgressHUD dismiss];
NSString *msg = nil ;
if(error != NULL){
msg = @"保存失败,请在'设置->隐私->照片'中开启应用访问照片的权限";
}else{
msg = @"保存成功";
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示"
message:msg
delegate:self
cancelButtonTitle:@"确定"
otherButtonTitles:nil];
[alert show];
[alert release];
}
NSString *data = [arguments objectAtIndex0];
UIImage *image = [UIImage imageWithData:[GTMBase64 decodeString:data]];
// UIImageWriteToSavedPhotosAlbum(image, nil,nil,nil);
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), NULL);
[SVProgressHUD show];
// 指定回调方法
- (void)image: (UIImage *) image didFinishSavingWithError: (NSError *) error contextInfo: (void *) contextInfo{
[SVProgressHUD dismiss];
NSString *msg = nil ;
if(error != NULL){
msg = @"保存失败,请在'设置->隐私->照片'中开启应用访问照片的权限";
}else{
msg = @"保存成功";
}
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"提示"
message:msg
delegate:self
cancelButtonTitle:@"确定"
otherButtonTitles:nil];
[alert show];
[alert release];
}
相关文章推荐
- IOS之文件夹创建、删除,图片在本地的保存和加载
- ios uiwebview 长按图片,保存到本地相册
- iOS从本地相册选取图片, 把图片保存到本地相册
- iOS 通过URL获取图片,并保存到本地
- IOS之文件夹创建、删除,图片在本地的保存和加载
- iOS图片保存到本地相册
- iOS 图片保存到本地相册
- iOS 保存和获取本地图片的封装函数
- iOS 使用ALAssetsLibrary保存图片到本地
- IOS之文件夹创建、删除,图片在本地的保存和加载
- 【学习ios之路:UI系列】获取通过UIImagePackerController获取的系统相册图片的名称信息及保存系统相册到本地
- IOS之文件夹创建、删除,图片在本地的保存和加载
- iOS 保存图片到本地相册
- iOS开发截屏并保存图片到本地相册以及长按保存图片到本地
- iOS下载图片保存在本地
- IOS图片保存到本地相册
- 编辑美化图片,保存至本地,Adobe出品(支持IOS,android,web调用)免费插件
- iOS 将图片保存到本地相册
- iOS开发小技巧--实现将图片保存到本地相册
- ios 调用writeToFile将图片保存到本地一直失败的解决方案