It is very important to properly initialize some libFoundation
internal data structures when the program starts. These information
are mainly related to the NSProcessInfo class. Because not on all
platforms is possible to find out the arguments and the environment
variables passed to the program, we have chosen to explicitly delegate
this task to user. The first lines in a libFoundation program,
before creating any other objects, should be the following:
int main (int argc, char** argv, char** env)
{
/* Declarations here */
...
#ifdef LIB_FOUNDATION_LIBRARY
[NSProcessInfo initializeWithArguments:argv
count:argc
environment:env];
#endif
/* Objects initialization and other instructions here */
...
}
Go to the first, previous, next, last section, table of contents.