如何把图片存储到相册簿

//保存图片的方法
- (IBAction)save {
    //将图片写入相册

    // Adds a photo to the saved photos album. The optional completionSelector should have the form:(官方提示你使用下面的方法来检测保存是否成功)

    // - (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo;

    UIImageWriteToSavedPhotosAlbum(self.imageView.image, self, @selector(image:didFinishSavingWithError:contextInfo:), nil);
}

- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo
{
    if (error) {
        [SVProgressHUD showErrorWithStatus:@"保存失败!"];
    }else {
        [SVProgressHUD showSuccessWithStatus:@"保存成功!"];
    }
}

你可能感兴趣的:(图片,uiimage)