NSTimer not firing

前端 未结 3 1281
野趣味
野趣味 2020-12-11 03:13

I have an NSTimer that I init with this code:

testTimer = [[NSTimer alloc] initWithFireDate:[new objectAtIndex:0] interval:0.0 target:self selector:@selector         


        
3条回答
  •  轮回少年
    2020-12-11 03:37

    I just recently had an issue with NSTimer. In my case I didn't realize that the method scheduledTimerWithTimeInterval is not multi thread safe. Once I moved the timer to the main thread it started working.

提交回复
热议问题