您的位置:首页 > 移动开发 > IOS开发

保存图片到本地相册

2016-06-01 16:53 676 查看
+ (void)saveImageToPhotos:(UIImage*)savedImage

{

    UIImageWriteToSavedPhotosAlbum(savedImage,
self, @selector(image:didFinishSavingWithError:contextInfo:),
NULL);

}

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

{

    NSString *msg =
nil ;

    if(error != NULL)

    {

        msg = @"保存图片失败" ;

    }

    else

    {

        msg = @"保存图片成功" ;

    }

    UIAlertView *alert = [[UIAlertView
alloc] initWithTitle:@"保存图片结果提示"
message:msg delegate:self
cancelButtonTitle:@"确定"
otherButtonTitles:nil];

    [alert show];

}
内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签:  iOS