【发布时间】:2011-12-31 15:07:00
【问题描述】:
我有一个应用程序,它应该每 1 秒记录一次某些事情,我目前正在使用NSTimer,但是如果我的应用程序转换屏幕(或几乎其他任何东西,真的)它会减慢计时器的速度用于不准确的读数。
什么是可靠的替代品?我目前的代码如下:
timer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(update) userInfo:nil repeats:YES];
【问题讨论】:
标签: iphone objective-c ios nstimer