0
我想第一次相當簡單,任何人都可以建議。我只是試圖用圖像文件名「IMG_2605.JPG」...「IMG_2650.JPG」爲一組照片製作動畫。下面是代碼:與UIImageView動畫故障
- (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
我加了一些測試,其實我的圖像陣列是沒有得到填補了所有:
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
}