NSTimer主线程子线程

NSTimer schedule..........默认在主线程中执行,这样当用户在拖拽控件的时候,主线程忙着去做这些事了,无暇顾及可怜的NSTimer.

所以要将其放到子线程中:

[NSRunLoop mainRunLoop]addTimer:self.timer forMode:NSRunLoopCommonModes];注意,如果是NSDefaultRunnLoopMode,依然是放在主线程

你可能感兴趣的:(timer)