2011-01-12 7 views
0
 UIImageView *campFireView=[[UIImageView alloc] initWithFrame:CGRectMake(0,0,320,480)]; 
     //UIImageView *campFireView =[[UIImageView alloc] initWithFrame:campFireView]; 

     // load all the frames of our animation 
     campFireView.animationImages = [NSArray arrayWithObject:[UIImage imageNamed:@"Img_0.jpg"], 
nil]; 
// all frames will execute in 1.75 seconds 
     campFireView.animationDuration = 1.75; 
     // repeat the annimation forever 
     campFireView.animationRepeatCount = 1000.0; 
     // start animating 
     [campFireView startAnimating]; 

     // add the animation view to the main window 
     [self.view addSubview:campFireView]; 

     [campFireView release]; 

ここでの問題は、1つの画像のみを設定したいのですが、arraywithobjectを使用していますが、このコードを実行するとエラーが発生しますarrayWithObjectの多くのパラメータ。何が問題ですか。誰でもこの問題を解決するのに手伝ってもらえますか目的地Cの特定の期間に画像を呼び出す方法

答えて

1

arrayWithObject:は1つのパラメータしか取らないので、,nilを削除してください。