libFoundation
libFoundation
. They do not change the general behavior of your program but they make your program work.
libFoundation
defines some preprocessor values so you can check for them if you want to conditionally pass some code to the compiler. The following macros are defined in Foundation/NSObject.h:
If you want to include a portion of code that is specific to libFoundation
you should put it inside an #ifdef
preprocessor command:
This way you the code inside #ifdef
is compiled only in the presence of libFoundation
and will not affect other libraries.
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:
libFoundation
however requires to have access to the resource files to function correctly. You can install only the resources in the installation directory, but there is more convenient way to let the library where are its resources. You can specify an environment variable that indicates where is the resource directory; the name of this variable is LIB_FOUNDATION_RESOURCES_PATH
and it should indicate the Resources
directory. In a sh
-like shell for example, you can do:
This environment variable is similar with the PATH
variable: you can specify more directories by separating them using :
character. Specifying resource directories this way takes precedence over the default installation directory. You can use this to change the resources if you want.