Finding Standard Directories

Frequently, you will construct a path or URL by appending your application’s specific path components to another well-known location, such as the user’s home directory, or the Application Support directory.

The functions NSHomeDirectory() and NSTemporaryDirectory() return paths to the home directory and temporary directory, respectively. There are also lookup functions and methods that give you other directories of interest. These share two configuration parameters.

The first is the search domain. There are a number of different locations where directories could be. For example, there are a number of Library directories: in the user’s home, in /Library, in /Network/Library, and /System/Library. When searching ...

Get Advanced Mac OS X Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.