Please help. I want to create countdown timer using iphone sdk. I have current time:
Code:
NSDate *today = [NSDate date];
NSDateFormatter *dateFormatter = [[NSDateFormatter alloc] init];
[dateFormatter setDateFormat:@"HH:mm"];
NSString *currentTime = [dateFormatter stringFromDate:today];
[dateFormatter release];
and time(s) from database. Eg.: currentTime is 19:18:30, time from database is 19:20:01. So the timer should be set to 0:01:31 and begin the countdown. When reach the 0:00:00, take another time from database (eg: 19:21:00), set up timer (0:00:59) and star countdown again. When reach the 0:00:00, take... The timer should be displayed by UILabel.
Please help. It begins to make me mad.