I am using an NSTimer which I have working to show minutes and seconds. But I am confused about the math needed to calculate hours.
I am using:
- (void)updateCounter:(NSTimer *)theTimer {
static int count = 0;
count += 1;
int seconds = count % 60;
int minutes = (count - seconds) / 60;
// Not sure how to calculate hours
int hours = (count - minutes) / 60;
self.timer.text = [NSString stringWithFormat:@"%.2d:%.2d:%.2d", hours, minutes, seconds];
}
What calculation should I use for hours?