当我试图将一些图像保存到相机胶卷时,所有图像都在一个数组中。将多张图像保存到相机胶卷,只保存了几张
if (buttonIndex == 1) {
int done = 0;
NSMutableArray *copyOfImages = [[NSMutableArray alloc]initWithArray:saveImagesToArray];
while (!done == 1){
if (copyOfImages.count == 0) {
done = 1;
}
if (copyOfImages.count > 0){
[copyOfImages removeLastObject];
}
UIImage *image = [[UIImage alloc]init];
image = [copyOfImages lastObject];
UIImageWriteToSavedPhotosAlbum(image, nil, nil, nil);
}
}
,因为我不知道有多少图像有可能是我使用while循环
进出口检验这8个图像,阵列显示为8的数量,使得那好。
当我尝试保存图像时出现在控制台中。
-[NSKeyedUnarchiver initForReadingWithData:]: data is NULL
在8张图片中,我试过了,只有5张照片出现在相机胶卷中。
任何帮助将是伟大的。 谢谢:)
好吧,我所做的更改,但仍然表现出了相同的控制台输出,并且只有5张图片显示了,所以我决定增加'睡眠(1);'在我将图像写入相机胶卷之后,它完全正常工作。你的循环虽然可能效果更好。谢谢! :D – Jacob