Nis*_*t B 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]); 
}
Run Code Online (Sandbox Code Playgroud)

这里,displayTime是Label.