将图片保存到本地的相册中:
//保存 -(void)SaveAction{ //保存到本地相册 UIImageView *imgVCSave=[[UIImageView alloc]init]; [imgVCSave setImageWithURL:[NSURL URLWithString:[_array_picURL objectAtIndex:_select_row]]]; UIImageWriteToSavedPhotosAlbum(imgVCSave.image, self, @selector(imageSaveToPhoto:didFinishSavingWithError:contextInfo:), nil); } - (void)imageSaveToPhoto:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo { NSString *message; if (!error) { message = @"成功保存到相册"; [SVProgressHUD showSuccessWithStatus:message]; }else { message = [error description]; } NSLog(@"message is %@",message); }
看一下官方文档:
|
||||||||
Availability | iOS (2.0 and later) |
---|