0

I have an NSView who draw something every second. Also, i have a setting window with some controls. The problem is that: When i want change settings, my view blocked. What can i do? For update the view I use NSTimer :

 NSTimer.scheduledTimerWithTimeInterval(refreshInterval, target: self, selector:"updateView", userInfo: nil, repeats: true)

and, in updateView function I call myView.needsDisplay = true ;

Is very annoying to try open an popUpButton and myView to freeze.

Have you any idea what can I do? Thanks!

C-Viorel
  • 1,801
  • 3
  • 22
  • 41
  • 1
    possible duplicate of [NSTimer not firing when NSMenu is open in Swift](http://stackoverflow.com/questions/27997485/nstimer-not-firing-when-nsmenu-is-open-in-swift) – Leo Dabus Mar 18 '15 at 17:28
  • This is strange. After add NSTimer to RunLoop , my view still freeze when i change settings... – C-Viorel Mar 18 '15 at 17:45
  • Then your problem is somewhere else. If you post your code it would be easier to identify the issue – Leo Dabus Mar 18 '15 at 18:02
  • Thanks for help. The problem was simple, but hard to find it. I create NSTimer in awakeFromNib(), but, after that, i check NSUserDefaults for last state,an i call some function, and invalidate my timer, so automatically NSRupLoop is dead. So when I make a new NSTimer, with another timeInterval, all i have to do is to add this timer to a new NSRunLoop. – C-Viorel Mar 18 '15 at 18:16

0 Answers0