UIImageWriteToSavedPhotosAlbum工作...有时 [英] UIImageWriteToSavedPhotosAlbum working... sometimes
问题描述
UIImageWriteToSavedPhotosAlbum只是有时工作。
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage :(UIImage *)image editingInfo:(NSDictionary *)editingInfo {
NSLog(@将图像保存到相机胶卷...);
UIImageWriteToSavedPhotosAlbum(image,nil,nil,nil);
NSLog(@Done!); }
我使用UIImagePicker控制器来获取调用该函数的图像。
有时候它会把它保存到相机胶卷中, p>
提前感谢。
编辑:
UIImageWriteToSavedPhotosAlbum的完成方法有时返回以下错误:
wait_fences:未能接收回复:10004003
我将首先添加一个完成目标方法到保存调用,任何错误。有关详细信息,请参阅 UIImageWriteToSavedPhotosAlbum
文档。
编辑:
其中一次返回...
wait_fences:未能接收回复:
10004003
这意味着操作超时。这有很多原因:
- 低内存:将日志放入
didReceiveMemoryWarning
以了解这是否是原因。 - 系统无法保存的损坏的文件。如果每次生成图像时可能不会每次都出来。
- 报告磁盘已满的错误。
我认为(1)最有可能解释间歇性。当你有足够的内存方法工作,当你不会失败。
此外,在编译时,请解决所有出现的警告。这些只是在运行时之前不会显示的错误。您遇到的问题可能会列在
UIImageWriteToSavedPhotosAlbum is only working sometimes. Sometimes it works, sometimes it doesn't, exact same function.
- (void)imagePickerController:(UIImagePickerController *)picker didFinishPickingImage:(UIImage *)image editingInfo:(NSDictionary *)editingInfo {
NSLog(@"Saving image to camera roll...");
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
NSLog(@"Done!"); }
I am using a UIImagePicker controller to get the image that then calls that function.
Sometimes it saves it to the camera roll, other times it simply doesn't.
Anyone has any idea?
Thanks in advance.
Edit:
The completion method for UIImageWriteToSavedPhotosAlbum sometime returns an error of:
wait_fences: failed to receive reply: 10004003
I would start by adding a completion target method to the save call to see if it is producing any errors. See the UIImageWriteToSavedPhotosAlbum
documentation for details.
Edit:
One of the times it returned... wait_fences: failed to receive reply: 10004003
That means the operation timed out. There are many causes of this:
- Low memory: put a log in
didReceiveMemoryWarning
to see if this is the cause. - Corrupt files that the system can't save. If the image is generated each time it might not come out right each time.
- Improperly reported disk full error.
I think (1) most likely and explains the intermittent nature. When you have enough memory the method works and when you don't it fails.
In addition, when you compile, resolve any warnings that come up. Those are just errors that won't show up until runtime. You're problem might be listed there
这篇关于UIImageWriteToSavedPhotosAlbum工作...有时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!