2010-04-01 46 views
-1

iam尝试用xcode播放动画,在specefic时间例如3分钟后播放动画..我不知道如何用NSTimer编码!用specefic时间播放动画[iPhone动画]

这里是我的动画代码:

 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]; 

回答

0

既然你提到你不知道如何使用NSTimer,现在是一个很好的学习时间。

阅读NSTimer的文档,并查看使用它的示例应用程序。

0

我想通了! :

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