-
-
Save bygri/2fa86d1c23c625d6153c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#import <Foundation/Foundation.h> | |
int main(int argc, const char * argv[]) | |
{ | |
NSRunLoop *runLoop; | |
CLIMain *main; // replace with desired class with properties BOOL shouldExist and int exitCode | |
@autoreleasepool | |
{ | |
runLoop = [NSRunLoop currentRunLoop]; | |
main = [[CLIMain alloc] init]; // replace with init method and manually start, if required | |
while( | |
!main.shouldExit && | |
[runLoop runMode:NSDefaultRunLoopMode beforeDate:[NSDate dateWithTimeIntervalSinceNow:2]] | |
); | |
} | |
return(main.exitCode); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment