2010-04-01 9 views
-1

iam essayant de jouer de l'animation avec xcode, au moment précis par exemple après 3 minutes jouer une animation .. je ne sais pas comment coder avec NSTimer!Jouer Animation avec temps specf [Animation iPhone]

ici est mes codes d'animation:

 NSArray *myImages = [NSArray arrayWithObjects: 
    [UIImage imageNamed:@"myImage1.png"], 
    [UIImage imageNamed:@"myImage2.png"], 
    [UIImage imageNamed:@"myImage3.png"], 
    [UIImage imageNamed:@"myImage4.gif"], nil]; 

    UIImageView *myAnimatedView = [UIImageView alloc]; 
[myAnimatedView initWithFrame:[self bounds]]; 
myAnimatedView.animationImages = myImages; 
myAnimatedView.animationDuration = 0.25; 
myAnimatedView.animationRepeatCount = 0; 
[myAnimatedView startAnimating]; 
[self addSubview:myAnimatedView]; [myAnimatedView release]; 

Répondre

0

Puisque vous avez mentionné que vous ne savez pas comment utiliser NSTimer, maintenant serait un bon moment pour apprendre.

Lisez la documentation pour NSTimer et consultez les exemples d'applications qui l'utilisent.

0

J'ai compris! :

[NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(myAction) userInfo:nil repeats:FALSE];