我有一个 NSTimer
timer = [NSTimer scheduledTimerWithTimeInterval:1
target:self
selector:@selector(periodicTimer)
userInfo:nil
repeats:YES];
哪个
- (void)periodicTimer
{
NSLog(@"Bang!");
if (timerStart != nil)
[timerLabel setText:[[NSDate date] timeDifference:timerStart]];
}
问题在于,在滚动表格视图(或执行其他任务)时,标签不会更新,此外,“砰!” 没有出现,所以我认为该方法不会被调用。
我的问题是即使用户正在使用应用程序界面,如何定期更新标签。