I am using
[NSTimer scheduledTimerWithTimeInterval:0.1f
target:self
selector:@selector(update)
userInfo:nil
repeats:YES];
I want to stop calling this timer one.
viewDidDisappear
How can i do that? invalidate?
Declare NSTimer *myTimer
in .h file.
Assign instance as tom said like this
myTimer = [NSTimer scheduledTimerWithTimeInterval:0.1f
target:self
selector:@selector(update)
userInfo:nil
repeats:YES];
Stop and Invalidate using this
- (void) viewDidDisappear:(BOOL)animated
{
[myTimer invalidate];
myTimer = nil;
}