2011-10-24 62 views
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 
    } 

回答

0

我解決這個問題;這實際上與我上面提到的任何事情都沒有關係,而是對我的images對象的簡單忽略。