I have a NSTimer
object that I need to invalidate if a user taps on a button or if they exit a view.
So I have:
[myNSTimer invalidate];
I have had the same problem while I was trying to pause & restart a timer. To stop it:
[timer invalidate];
[timer release];
timer = nil;
And to start/ restart it:
timer = [[NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(aSelector) userInfo:nil repeats:YES] retain];
Now it doesn't crash when I invalidate it.