开发者

Timer delayed by resizing window

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];
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜