I’m trying something rather simple for the first time, can anyone advise. I’m just trying to animate a bunch of photos with the image file name “IMG_2605.JPG”…”IMG_2650.JPG”. Here is the code:
- (void)viewDidLoad
{
for (int i=2605; i<=2650;i++){
NSString * temp=[[NSString alloc]initWithFormat:@"IMG_%d.JPG",i];
NSLog(@"%@",temp); //this reveals correctly named image files
UIImage *image=[UIImage imageNamed:temp];
self.animations.image=[UIImage imageNamed:temp]; //this works for static image
[temp release];
[self.images addObject:image];
}
self.animations.animationImages=self.images;
[self.animations startAnimating]; // this does nothing
NSLog(@"animating? %i",self.animations.isAnimating);// reports 0
[super viewDidLoad];
}
UPDATE
I added some tests and in fact my images array is not getting filled up at all:
NSLog(@"size of images: %d",[self.images count]);// reports zero
for (id key in self.images){
UIImage *test=key;
NSLog(@"hello");// not a dern thing gets NSLogged
}
i resolved this issue; it was in fact unrelated to anything i noted above, but rather a simple oversight on my
imagesobject.