-(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;
}
}
XcodeはNSString
、データ引数がフォーマット文字列で使用されていないことを行で伝えており、タイマーを実行しようとするたびに表示されるのは、2d:.2d
Objective Cをよく知っている人は私のコードを見てください.