I am making an \'event countdown\' scene in my app that uses a UITableViewController to show a list of events that are happening in the future. In each cell I have a countdown t
Some more searching on this same issue for UIScrollViews yielded led me to this postMy custom UI elements...
Basically what is happening is that the NSTimer I was using was not being updated when scrolling because scrolling blocks everything outside of its own run loop mode. The fix is to add the animation NSTimer to the same run loop mode that is used by scrolling: NSRunLoopCommonModes
Here's how to do it in code:
NSTimer *timer = [NSTimer timerWithTimeInterval:0.25 self selector:@selector(updateCountdownLabels) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:timer forMode:NSRunLoopCommonModes];
I am guessing you are using views to store your countdown data. Instead create a model for countdown, it could be initialized with a start date(NSDate) and a duration(NSTimeInterval). Then instead of your views update those Countdown objects according to timer. When a tableview cell becomes visible in the view, it will load data from the corresponding Countdown object and everything should run smoothly.