保存图片到相册

来源:互联网 发布:java向数据库添加数据 编辑:程序博客网 时间:2024/05/04 10:55
<span style="font-family: Arial, Helvetica, sans-serif;">UIImageWriteToSavedPhotosAlbum(_myImg, self, @selector(imageSavedToPhotosAlbum:didFinishSavingWithError:contextInfo:), nil);</span>
上面的_myimg 就是需要保存的 uiimage  图片
- (void)imageSavedToPhotosAlbum:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{    NSString *message = @"提示";    if (!error) {        message = @"成功保存到相册";    }else    {        message = [error description];    }    NSLog(@"message is %@",message);        self.view.userInteractionEnabled = YES;            [self presentMessageTips:message];}


要注意的时候 在设置的隐私 一定要把相机选项打开不然保存不了!

0 0
原创粉丝点击