iOS基础(九)——保存图片到本地
1、保存图片到本地
#pragma mark ==========保存图片==========
- (void)loadImageFinished:(UIImage *)image
{
UIImageWriteToSavedPhotosAlbum(image, self, @selector(image:didFinishSavingWithError:contextInfo:), (__bridge void *)self);
}
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
[MBProgressHUD showSuccessMessage:@"图片已保存到相册"];
NSLog(@"image = %@, error = %@, contextInfo = %@", image, error, contextInfo);
}
2、要设置访问权限