NSSearchPathForDirectoriesInDomains
is how you find the location of things like Library directories, or User directories, document directory, and the like (this is theNSSearchPathDirectory
). TheNSSearchPathDomainMask
is what domains to find things in. For instance for aNSLibraryDirectory
, aNSUserDomainMask
will give you the path to~/Library
,NSSystemDomainMask
will give you the path to/System/Library
, and so on.The directories inside of Library, like "Preferences" and "Application Support" are in English in the file system, and the Finder presents localized versions to the user. If you need
~/Library/Application Support/Borkware
, you can construct it likeNSMutableString *path; path = [[NSMutableString alloc] init]; // find /User/user-name/Library NSArray *directories; directories = NSSearchPathForDirectoriesInDomains (NSLibraryDirectory, NSUserDomainMask, YES); // if you had more than one user domain, you would walk directories and // work with each path [path appendString: [directories objectAtIndex: 0]]; [path appendString: @"/Application Support"]; [path appendString: @"/Borkware"];