iam trying play animation with xcode,in specefic Time for example after 3 minutes play an animation .. i don't know how coding with NSTimer !
here is my animation codes :
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开发者_JAVA技巧.25;
myAnimatedView.animationRepeatCount = 0;
[myAnimatedView startAnimating];
[self addSubview:myAnimatedView]; [myAnimatedView release];
Since you mentioned you don't know how to use NSTimer
, now would be a good time to learn.
Read the documentation for NSTimer
and look at the sample apps that use it.
i figured out ! :
[NSTimer scheduledTimerWithTimeInterval:5 target:self selector:@selector(myAction) userInfo:nil repeats:FALSE];
精彩评论