Work was on the road to learning Objective-C, but I returned to it now, and it infuriated me.
This is my code:
i=0;
for (i=0;[photoList count]; i++) {
NSLog(@"%i",i);
NSLog(@"%@",[photoList objectAtIndex:i]);
NSString *fileName = [photoList objectAtIndex:i];
sendImage = [UIImage imageWithContentsOfFile:[[NSBundle mainBundle] pathForResource:fileName ofType:nil]];
UIImageWriteToSavedPhotosAlbum(sendImage,self,@selector(savedPhotoImage:didFinishSavingWithError:contextInfo:),NULL);}
photoList is just an NSArray, for example, with the exception of 24 objects:
NSArray* photoList = [NSArray arrayWithObjects:@"Photo 1.jpg",
@"Photo 2.jpg",
@"Photo 3.jpg",
@"Photo 4.jpg",nil];
It works ... It copies the photos to the camera frame ... and then resets using
2010-07-24 19: 34: 36.116 iCardz2go Poindexter [29662: 207] * Application terminated due to an uncaught exception 'NSRangeException', reason: '* - [NSArray objectAtIndex:]: index 24 outside [0 .. 23] ''
I tried various configurations like
for (i=0;1<23; i++)
2010-07-24 19: 51: 01.017 iCardz2go Poindexter [29908: 207] *** - "NSInvalidArgumentException", : "+ [NSInvocation invocationWithMethodSignature:]: nil '
, .
, , . Photo 23 (count)?
!