NSPopButton Stops NSTimer on main thread during selection

45 Views Asked by At

I have multiple timers that working on the main thread.
And I have a NSPopButton.
And I experience a bad behavior, timers just don't work, starting from the point that the use open the pop button's menu until he close the menu.
Any Ideas?

1

There are 1 best solutions below

0
Vin Gazoil On BEST ANSWER

This is probably because your NSTimer is running on the UI thread. You should run it on another thread like so:

NSTimer *myTimer = …
[[NSRunLoop mainRunLoop] addTimer:myTimer forMode:NSRunLoopCommonModes];