0
我的NSTimer正在工作,但只是倒計時秒?分鐘顯示爲「00」,秒數倒數,分鐘保持爲零。 int countdownInt來自用戶輸入,我一直在測試45分鐘倒計時器輸入「45」。唯一發生的事情是秒數從「45」開始倒數? countdownInt,秒和分鐘都在.h文件中聲明爲intNSTimer只能倒數秒?
感謝您的幫助!
countdownInt -=1;
seconds = countdownInt % 60;
minutes = (countdownInt/60) % 60;
countdownTimerLabel.text = [NSString stringWithFormat:@"%02d:%02d", minutes, seconds];
謝謝!這就是答案! – user1304216 2012-04-27 18:27:18