所以我在玩一些應用程序,我試圖讓遊戲計時器以毫秒爲單位,而不是普通的1,2,3。我希望它的格式與1.000,2.000相似。甚至1.00,2.00。以毫秒爲單位顯示遊戲時間Xcode
這是我的代碼:
(void)startTimer {
if (count == 30) {
// 3
timer = [NSTimer scheduledTimerWithTimeInterval:1.0
target: self
selector:@selector(ElapsedTime)
userInfo:nil
repeats:YES];
'count'從哪裏來? –
來自標籤的計數。每次按下按鈕時,標籤都設置爲從30開始倒數。我想要時間,這就是爲什麼我想要一個更好的計時器。 – user3667192
http://stackoverflow.com/questions/23457847/show-timer-with-milliseconds-in-a-label –