I'm making a CLI tool for Mac OS X, my main looks something like this:
int main(int argc, const char * argv[]){
@autoreleasepool {
//Some startup stuff here
[ServerPool sharedPool]; //Start the pool
/*
UI stuff for cli version
*/
while (1){
[[CLIUI sharedCLI] mainMenu];
[[CLIUI sharedCLI] menuInput];
}
}
return 0;
}
and in another section of the code I am starting a NSTimer
progressUpdateTimer = [NSTimer timerWithTimeInterval:1.0
target:self
selector:@selector(updateProgress:)
userInfo:nil
repeats:YES];
[[NSRunLoop currentRunLoop] addTimer: progressUpdateTimer forMode:NSDefaultRunLoopMode];
However, it never fires the selector updateProgress:. I believe this is because I do not have an NSRunLoop established in my main, what would be the proper fix for this?