I’m trying to run a timer while running an NSWindow as modal, but unfortunately it doesn’t work at all. The log is called, the window appears and turns modal, but the timer is never called – why? Am I missing something?
NSLog(@"Checking...");
[[NSApplication sharedApplication] runModalForWindow:_Window];
_checkTimer = [NSTimer timerWithTimeInterval:1 target:self selector:@selector(check:) userInfo:nil repeats:YES];
[[NSRunLoop currentRunLoop] addTimer:_checkTimer
forMode:NSDefaultRunLoopMode];
[[NSRunLoop currentRunLoop] addTimer: _checkTimer
forMode:NSModalPanelRunLoopMode];
Try doing your timer/runloop stuff before starting the modal session.