Я впервые пробую что-то довольно простое, может кто-нибудь посоветовать.Я просто пытаюсь анимировать кучу фотографий с именем файла изображения "IMG_2605.JPG" ... "IMG_2650.JPG".Вот код:
- (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];
}
ОБНОВЛЕНИЕ
Я добавил несколько тестов, и фактически мой массив изображений вообще не заполняется:
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
}