以特定时间播放动画[iPhone动画]

时间:2010-04-01 14:52:19

标签: iphone

iam尝试使用xcode播放动画,在特定的时间例如3分钟后播放动画..我不知道如何用NSTimer编码!

这是我的动画代码:

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

2 个答案:

答案 0 :(得分:0)

由于您提到您不知道如何使用NSTimer,现在是学习的好时机。

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

答案 1 :(得分:0)

我发现了! :

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