无法写入(添加 UIImage)到相册
我有以下代码
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{
NSLog(@"failed");
}
来检查错误,并打印出我运行以下代码的时间:
-(IBAction) addWallpaper{
UIImageWriteToSavedPhotosAlbum( [UIImage imageNamed:[NSString stringWithFormat:@"%d.png", r]]
, self, @selector(image:didFinishSavingWithError:contextInfo:), nil );
}
如何正确地将 UIImage 保存到相册?
I have the following code
- (void)image:(UIImage *)image didFinishSavingWithError:(NSError *)error contextInfo:(void *)contextInfo{
NSLog(@"failed");
}
which checks for the error, and it prints out time I run the following
-(IBAction) addWallpaper{
UIImageWriteToSavedPhotosAlbum( [UIImage imageNamed:[NSString stringWithFormat:@"%d.png", r]]
, self, @selector(image:didFinishSavingWithError:contextInfo:), nil );
}
How do I correctly saved the UIImage to the photo album?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尽管名称
并不表示错误。您需要检查传递给此函数的
error
。像这样的东西:
Despite the name
doesn't indicate an error. You need to check the
error
passed to this function.Something like: