答案 0 :(得分:10)
添加以下功能并在此功能中传递“秒”值。
- (void)displayTimeWithSecond:(NSInteger)seconds
{
NSInteger remindMinute = seconds / 60;
NSInteger remindHours = remindMinute / 60;
NSInteger remindMinutes = seconds - (remindHours * 3600);
NSInteger remindMinuteNew = remindMinutes / 60;
NSInteger remindSecond = seconds - (remindMinuteNew * 60) - (remindHours * 3600);
NSLog(@"Hours = %@", [NSString stringWithFormat:@"%02d",remindHours]);
NSLog(@"Minute = %@", [NSString stringWithFormat:@"%02d",remindMinuteNew]);
NSLog(@"Seconds = %@", [NSString stringWithFormat:@"%02d",remindSecond]);
}
这里,displayTime是Label。