I'm trying to repeat an animation until a certain condition is met. Something like this:
- (void) animateUpdate {
if (inUpdate) {
[UIView beginAnimations:nil context:NULL];
[UIView setAnimationDuration:2.0];
[UIView setAnimationDelegate: self];
[UIView setAnimationDidStopSelector: @selector(animateUpdate)];
button.transform = CGAffineTransformMakeRotation( M_PI );
[UIView commitAnimations];
}
}
This will run the first time, but it won't repeat. The selector will just be called until the application crashes.
How should I do this?
Thanks.