What am I doing wrong here? What am I missing?
- (void)scheduleTimer
{
NSTimer *timer = [NSTimer timerWithTimeInterval:0.15
target:self
selector:@selector(wtf:)
userInfo:nil
repeats:NO];
// This works fine
// [[NSRunLoop currentRunLoop] addTimer:timer
// forMode:NSDefaultRunLoopMode];
// This doesn't work at all - how come?
[[NSRunLoop currentRunLoop] addTimer:timer
forMode:@"MyCustomRunLoopMode"];
}
- (void)wtf:(NSTimer *)aTimer
{
NSLog(@"wtf");
}
The documentation for NSRunLoop seems to indicate one can create custom runloop modes. Am I missing something?
(This is on the main thread of a standard GUI application in Mac OS X)
Update: Notice that I mentioned this was on the main thread of a standard application. Therefore, I'm not running the runloop myself. It's all being handled by NSApplication.