I am trying to use a timer to fire the onTick method once after a 0.5 second delay using the following Objective C code in Xcode for a MacOS target
[NSTimer scheduledTimerWithTimeInterval:0.5
target: self
selector:@selector(onTick:)
userInfo:nil repeats:NO];
...
-(void) onTick
{
}
But the selector onTick never fires. The code is in AppDelegate.m and is running on the main thread. What am I doing wrong?
Change
to
(notice the deleted colon).