O'Reilly logo

Objective-C Phrase Book, Second Edition by David Chisnall

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

10. Interacting with the Environment

Objective-C is generally used on UNIX-like platforms, and it inherits the notion of an environment from there. This includes concepts such as a working directory, environment variables, and so on.

In a traditional Objective-C environment, you were expected to get these values in exactly the same way you would from a C program. With OpenStep, Sun and NeXT introduced the NSProcessInfo class, which provides a higher level of abstraction.

Part of the motivation for this was the fact OpenStep programs were expected to run on OPENSTEP, Solaris, and Windows NT. All of these have subtle differences in their idea of an environment, and some abstraction was required to hide them.

Getting Environment Variables

From: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required