I am using an animated UIImage
, and would like it to stop after repeating once. So logically, I use the animationRepeatCounter
property. However, when the property is set to anything besides 0, the image doesn't ever appear!
NSMutableArray * imageArray = [NSMutableArray arrayWithCapacity:85];
for (int i = 1; i<86; i++)
{
NSString *imagename = [NSString stringWithFormat:@"animation_image_%d.png", i];
UIImage *tempImage = [UIImage imageNamed:imagename];
[imageArray addObject:tempImage];
}
self.setupAnimation.animationImages = imageArray;
self.setupAnimation.animationDuration = 3.0;
self.setupAnimation.animationRepeatCount = 1;
[self.setupAnimation startAnimating];
}
If animationRepeatCount
is set to 0, all works well (I see the image animating indefinitely). When it is set to any other number, it doesn't appear. 'self.setupAnimation'
is:
@property (retain, nonatomic) IBOutlet UIImageView *setupAnimation;
Any ideas why this would happen?