I have a repeating timer installed like this:
_cmdTimer = [NSTimer timerWithTimeInterval: 0.5
target: self
selector: @selector(timedTask:)
userInfo: nil
repeats: YES];
[NSRunLoop.mainRunLoop addTimer: _cmdTimer
forMode: NSModalPanelRunLoopMode];
[NSRunLoop.mainRunLoop addTimer: _cmdTimer
forMode: NSDefaultRunLoopMode];
The first time the timer fires, it opens a modal dialog. But then the timer does not fire again until the dialog is closed. I don't get that, since I scheduled the timer in NSModalPanelRunLoopMode
. To verify that the dialog was running in that mode, just before opening the dialog I said
[self performSelector: @selector(testMe)
withObject: nil
afterDelay: 0.7
inModes: @[NSModalPanelRunLoopMode] ];
and the testMe
method did get executed while the dialog was open.