I am run NSRunLoop
with NSTimer
on a custom cell in order to continuously update the "Valid Until" UILabel
. It works fine until I close the tableView, the NSRunLoop
continues the time countdown. I use dealloc
, but seems it doesn't drain NSRunLoop
and NSTimer
.
-(void)dealloc {
[[NSNotificationCenter defaultCenter]removeObserver:self];
[_timer invalidate];
CFRunLoopStop(CFRunLoopGetCurrent());
_runner = nil; // NSRunLoop
}
How can I kill the NSRunLoop
when a cell gets released? Thank you in advance.