Reputation: 9
I have a animation assigned to the uiimageview with the following code
Fire.animationImages = [NSArray arrayWithObjects:
[UIImage imageNamed:@"firework1.png"],
[UIImage imageNamed:@"firework2.png"],
[UIImage imageNamed:@"firework3.png"],
[UIImage imageNamed:@"firework10.png"],nil];
[Fire setAnimationRepeatCount:0];
Fire.animationDuration = 0.5;
[Fire startAnimating];
I want the animation to stop when it reaches 0.5 I tried a if statement but it didn't work. Please help.
Upvotes: 0
Views: 87
Reputation: 56
According to the UIImageView documentation setting the animation repeat count to 0 will make it repeat indefinitely, try using [Fire setAnimationRepeatCount:1];
instead.
Upvotes: 1