这timmer在我的所有设备(5,Ipad和两个4S)上效果很好,但它似乎不适用于我拥有的两个3GS。由于某种原因,3秒钟的时间真的很慢。 继承人视频说明问题:随着时间的交易非常有趣的不同设备上的时间差异
而且继承人的代码:
- (void)showTime
{
int hours = 0;
int minutes = 0;
int seconds = 0;
int hundredths = 0;
NSArray *timeArray = [NSArray arrayWithObjects:self.hun.text, self.sec.text, self.min.text, self.hr.text, nil];
for (int i = [timeArray count] - 1; i >= 0; i--) {
int timeComponent = [[timeArray objectAtIndex:i] intValue];
switch (i) {
case 3:
hours = timeComponent;
break;
case 2:
minutes = timeComponent;
break;
case 1:
seconds = timeComponent;
break;
case 0:
hundredths = timeComponent;
hundredths++;
score++;
break;
default:
break;
}
}
if (hundredths == 100) {
seconds++;
hundredths = 0;
}
else if (seconds == 60) {
minutes++;
seconds = 0;
}
else if (minutes == 60) {
hours++;
minutes = 0;
}
self.hr.text = [NSString stringWithFormat:@"%.0d", hours];
self.min.text = [NSString stringWithFormat:@"%.2d", minutes];
self.sec.text = [NSString stringWithFormat:@"%.2d", seconds];
self.hun.text = [NSString stringWithFormat:@"%.2d", hundredths];
scoreLabel.text= [NSString stringWithFormat:@"%i",score];
请帮我揣摩什么怎么回事。它在我需要做的事情上丢失的新设备上运行良好。
预先感谢您!
谢谢。我会试试看看它是如何工作的! – aasatt