I have a NSTimer who ticks every 0.x seco开发者_运维百科nds. I also have a button that enables to show or hide controls hereby resizing the window.
I noticed however that by clicking the button and resizing the window significantly delays the timer, for example if i repeatedly click the resize button my timer my run several seconds late.
Can anybody advice me on how to fix this?
Try adding it to the common run loop modes:
// alloc/init your timer here
[[NSRunLoop currentRunLoop] addTimer:yourTimer forMode:NSRunLoopCommonModes];
精彩评论