Hey so i am just making an example application and i am having a little trouble, So i have a table view and then i have a few rows and when a user clicks a row it takes them
4 year old post, I know but maybe I can save the NEXT guy from wasting time trying invalidate a NSTimer. Apples documentation explains it and it works for me.
in .h
@property(nonatomic, retain) NSTimer *yourTimer;
@property(weak) NSTimer *repeatingTimer;
in .m
@synthesize yourTimer, repeatingTimer;
in viewDidLoad
yourTimer = [NSTimer scheduledTimerWithTimeInterval:(NSTimerInterval)(40.0/60.0)
target:self
selector:@selector(blink)
userInfo:nil
repeats:TRUE];
self.repeatingTimer = yourTimer;
in my viewDidDisappear
[repeatingTimer invalidate];
repeatingTimer = nil;
the trick is in the assignment of the first NSTimer to (weak) NStimer object and killing THAT object.