Accessing command line arguments in Objective-C

iPadDevloperJr picture iPadDevloperJr · Feb 28, 2011 · Viewed 21.7k times · Source

Is there any complete documentation (the interface is present in crt_externs.h) about this functions : _NSGetArgc and _NSGetArgv I can't get any documentation on the apple website about this functions.

Answer

Wevah picture Wevah · Feb 28, 2011

If all you need to do is get the command line arguments in Cocoa, you can do:

NSArray *arguments = [[NSProcessInfo processInfo] arguments];