Я пробую что-то довольно простое в первый раз, может кто посоветует. Я просто пытаюсь анимировать кучу фотографий с именем файла изображения "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
}