It is even easier. First add the .h file:
@property (nonatomic, retain) IBOutlet UIImageView *iV;
After that, plug this outlet into the actual UIImageView on your storyboard. Change your code:
iV.animationImages = myImages; iV.animationDuration = 0.25; iV.animationRepeatCount = 1; [iV startAnimating];
And it's all. Hope this helps
ps And yes, don't forget iV = nil; in - (void) viewDidUnload
UPD: added
[self performSelector:@selector(animationDone) withObject:nil afterDelay:0.25];
After starting, make a call and obviously add the animationDone method:
- (void)animationDone { [iV stopAnimating]; [iV setImage:[UIImage imageNamed:@"bookmark5.png"]]; }
source share