Possible Duplicate:
UIScrollView pauses NSTimer until scrolling finishes
I have a scrollview and a label to show the countdown to date. I got the countdown working but whenever I drag the scrollview up and down the countdown stopped but when I release my finger it started working again. I know it has to do with muti-threading. Here is my code
-(void) viewdidload
{
timer = [NSTimer scheduledTimerWithTimeInterval:0 target:self selector:@selector(updateLabel) userInfo:nil repeats:YES];
}
-(void)updateLabel {
NSCalendar *calender = [[NSCalendar alloc] initWithCalendarIdentifier:NSGregorianCalendar];
NSDateComponents *countdown = [calender
components:(NSDayCalendarUnit | NSHourCalendarUnit | NSMinuteCalendarUnit | NSSecondCalendarUnit)
fromDate:[NSDate date]
toDate:destDate
options:0];
timerCountDown.text = [NSString stringWithFormat:@"%dday %dh %dm %ds", [countdown day],[countdown hour],[countdown minute],[countdown second]];
}