我有实现 NSTimer 对象的单例。
我使用下面的代码运行我的计时器
self.myTimer = [NSTimer scheduledTimerWithTimeInterval: 1.0
target: self
selector: @selector(onTick:)
userInfo: nil repeats:YES];
我有NSUInteger
实例变量,每次- onTick:
调用方法时都会增加(所以,每秒一次)。
我有UILabel
它代表我的 NSUInteger
实例变量的日期,它工作得很好。在我看来,我UIScrollView
也有。当我滚动它时,我UILabel
不会更新文本。即使在方法中显示有关计时器滴答信息的 NSLog 也- onTick:
不起作用。如果我不滚动计时器开始工作。