I'm trying to run this animation which is working fine, but I want the last number to stay on the screen. currently it runs through the array then disappears.. is there anyway to stop the animation on the number that is passed in?
- (void)playAnimationToNumber:(int)number{
NSMutableArray *imagesForAnimation = [[NSMutableArray alloc] initWithCapacity:0];
for (int counter=1; counter<=number; counter++) {
NSString *imageNameForFirstNumber = [NSString stringWithFormat:@"Flap%i.png", counter];
[imagesForAnimation addObject:[UIImage imageNamed:@"FlapMoving1.png"]];
[imagesForAnimation addObject:[UIImage imageNamed:@"FlapMoving2.png"]];
[imagesForAnimation addObject:[UIImage imageNamed:imageNameForFirstNumber]];
}
animationArray.animationImages = [NSArray arrayWithArray:imagesForAnimation];
animationArray.animationDuration = 1.2;
animationArray.animationRepeatCount = 1;
[animationArray startAnimating];
[self.view addSubview:animationArray];
[imagesForAnimation release];
}