[self.myTimer invalidate];You can call [nil method] without problems in iOS.
self.myTimer = nil;
self.myTimer = [NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(updateTime)
userInfo:nil
repeats:YES];
Showing posts with label invalidate. Show all posts
Showing posts with label invalidate. Show all posts
Friday, November 19, 2010
Why Doesn't Repeating NSTimer Invalidate
Most likely your timer is started more than once. If you can't find why that happens (or is done by iOS for unknown reasons), easy and safe fix is to invalidate your timer just before you create it:
Subscribe to:
Posts (Atom)