The Cocotron is an open source project which aims to implement a cross-platform Objective-C API similar to that described by Apple Inc.'s Cocoa documentation. This includes the AppKit, Foundation, Objective-C runtime and support APIs such as CoreGraphics and CoreFoundation.

Cocotron Code

If you are not using NSApplicationMain()

NSInitializeProcess(argc,argv) must to be called before any Objective-C in main() as it initializes the Objective-C runtime and the command line in NSProcessInfo.

int main(int argc, const char *argv[]) {
   NSInitializeProcess(argc,argv);
   // ... rest of program ...
}

and of course sadly we typically have to use #ifdef's

int main(int argc, const char *argv[]) {
#ifndef __APPLE__
   NSInitializeProcess(argc,argv);
#endif
   // ... rest of program ...
}

If you are using NSApplicationMain like so:

int main(int argc, const char *argv[]) {
   return NSApplicationMain(argc, argv);
}
You don't need to use NSInitializeProcess as NSApplicationMain calls NSInitializeProcess.

While I would agree this this is not the most transparent way of initializing the command line arguments it saves the hassle of maintaining custom C runtime initialization for each platform.