UIImageWriteToSavedPhotosAlbum 仅保存 10 张图像中的 5 张。为什么?
正如标题所示,我遇到了问题。 是否有任何限制,例如“每秒仅导出 3 个图像”或类似的限制?
for (int frameStepper = 0; frameStepper < [Something frameCount]; frameStepper++)
{
//Get the filename.
imagePath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"frame_%i.jpg", frameStepper]];
//Read image.
UIImage *image = [[[UIImage alloc] initWithContentsOfFile:imagePath] autorelease];
//Write image.
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
}
执行此代码后,我导出了 10 张图像中的 5 张。看不出为什么。请帮忙,非常感谢。
I have the problem as the title goes.
Are there any restrictions, like "Export only 3 image per second", or something like?
for (int frameStepper = 0; frameStepper < [Something frameCount]; frameStepper++)
{
//Get the filename.
imagePath = [documentsDirectory stringByAppendingPathComponent:[NSString stringWithFormat:@"frame_%i.jpg", frameStepper]];
//Read image.
UIImage *image = [[[UIImage alloc] initWithContentsOfFile:imagePath] autorelease];
//Write image.
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
}
I have 5 images exported out of 10 after this code. Cannot see why. Please help, many thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
这个的一个变体帮助了我:
http://iphoneincubator.com/blog/tag/uiimagewritetosavedphotosalbum
A variation of this helped me:
http://iphoneincubator.com/blog/tag/uiimagewritetosavedphotosalbum
如果我记录完成错误,它会说:
这意味着我必须通过实现给定的回调来等待正在运行的进程完成:
Hurray。
If I log the error of completion, it says:
That means I have to wait for the completition of the running processes by implementing the given callback:
Hurray.