2011-10-24 12 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オブジェクトの簡単な見落としです。

関連する問題