阅读背景:

IOS 中将NSInteger类型的秒,转换为00:00:00格式_风---的专栏

来源:互联网 
NSInteger secCount = [timeDate timeIntervalSinceDate:lastStartTime];
            self.contractions.FrequencySec = [NSNumber numberWithInt:secCount];
            
            NSString *tmphh = [NSString stringWithFormat:@"%d",secCount/3600];
            if ([tmphh length] == 1) 
            {
                tmphh = [NSString stringWithFormat:@"0%@",tmphh];
            }
            NSString *tmpmm = [NSString stringWithFormat:@"%d",(secCount/60)%60];
            if ([tmpmm length] == 1) 
            {
                tmpmm = [NSString stringWithFormat:@"0%@",tmpmm];
            }
            NSString *tmpss = [NSString stringWithFormat:@"%d",secCount%60];
            if ([tmpss length] == 1) 
            {
                tmpss = [NSString stringWithFormat:@"0%@",tmpss];
            }
            self.contractions.FrequencyStr = [NSString stringWithFormat:@"%@:%@:%@",tmphh,tmpmm,tmpss];
            self.frequencyLabel.text = self.contractions.FrequencyStr;NSInteger secCount = [timeDate timeIntervalSinc



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: