1

When saving multiple images (720x1280 each size) this obvious method below does its job well. However, my app saves up to 10 images in a row and, strangely enough, while I do see log prints all 10 images, in the Photo Album I can see only 5 or so.

Is this a single-threading issue?

-(void)saveAllItems:(NSTimer*)sender{
    for(int i=0;i<[imagePaths count];i++){
      NSString *path = (NSString*)[imagePaths objectAtIndex:i];
      UIImage *img = [[UIImage alloc]initWithContentsOfFile:path];
      NSLog(@"saveAllItems: saving %d %@",i,path);
      UIImageWriteToSavedPhotosAlbum(img , nil, nil, nil);
    }
}
Vad
  • 3,658
  • 8
  • 46
  • 81
  • Ill bet your paths are wrong then. – CodaFi Apr 02 '12 at 03:51
  • 1
    Near duplicate of http://stackoverflow.com/questions/3017681/uiimagewritetosavedphotosalbum-working-sometimes which has a good answer. – matt Apr 02 '12 at 03:55
  • 1
    this method is asynchronous so its possible the save is still happening in background. Do all the images eventually appear? supply callbacks to see if it was a success/failure – amleszk Apr 02 '12 at 03:55

0 Answers0