I am using multiple NStimers into my cocoa (MAC) application and i have added all of them in NSRunLoopCommonModes separately like below:
NSRunLoop *runloop = [NSRunLoop currentRunLoop];
updateServerTimeTimer = [NSTimer scheduledTimerWithTimeInterval:1.0 target:self selector:@selector(updateServerTime) userInfo:nil repeats:YES];
[runloop addTimer:updateServerTimeTimer forMode:NSRunLoopCommonModes];
But after some time, my app. gets hung and also UI responds late. It is also slowing down my MAC, Can anyone provide a better approach to use multiple timers continuously within an application
来源:https://stackoverflow.com/questions/12907514/multiple-nstimers-slows-down-the-application