Creates a list of directory search paths.


NSArray<NSString *> * NSSearchPathForDirectoriesInDomains(NSSearchPathDirectory directory, NSSearchPathDomainMask domainMask, BOOL expandTilde);


Creates a list of path strings for the specified directories in the specified domains. The list is in the order in which you should search the directories. If expandTilde is YES, tildes are expanded as described in stringByExpandingTildeInPath.

You should consider using the NSFileManager methods URLsForDirectory:inDomains: and URLForDirectory:inDomain:appropriateForURL:create:error:. which return URLs, which are the preferred format.

For more information on file system utilities, see File System Programming Guide.

See Also

Locating System Directories

- URLForDirectory:inDomain:appropriateForURL:create:error:

Locates and optionally creates the specified common directory in a domain.

- URLsForDirectory:inDomains:

Returns an array of URLs for the specified common directory in the requested domains.


Returns the root directory of the user’s system.