I\'m using an NSTimer to do some rendering in an OpenGL based iPhone app. I have a modal dialog box that pops up and requests user input. While the user is providing input
The easiest way I managed to do it was like this:
-(void) timerToggle{
if (theTimer == nil) {
float theInterval = 1.0/30.0;
theTimer = [NSTimer scheduledTimerWithTimeInterval:theInterval target:self selector:@selector(animateBall:) userInfo:nil repeats:YES];
} else {
[theTimer invalidate];
theTimer = nil;
}
}