-(void) timerRun{
secondsCount = secondsCount - 1;
int minuts = secondsCount /60;
int seconds = secondsCount - (minuts * 60);
NSString *timerOutput = [NSString stringWithFormat: @"%2d:.2d" , minuts, seconds];
countdownLabel.text = timerOutput;
if (secondsCount == 0) {
[countdownTimer invalidate];
countdownLabel = nil;
}
}
XcodeNSString
在行中告诉我格式字符串未使用数据参数,并且每次我尝试运行计时器时,都会出现:是否2d:.2d
有了解 Objective C 的人请查看我的代码。