0
분과 초를 표시하는 NSTimer를 사용하고 있습니다. 그러나 시간을 계산하는 데 필요한 수학에 대해 혼란 스럽습니다.NSTimer 계산 시간
내가 사용하고 있습니다 :
- (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];
}
내가 시간 동안 어떤 계산을 사용해야합니까?