2011-10-24 66 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对象的简单忽略。