Re: Getting path to ~/Library/Application Support/
Re: Getting path to ~/Library/Application Support/
- Subject: Re: Getting path to ~/Library/Application Support/
- From: Jim Correia <email@hidden>
- Date: Sun, 16 Dec 2001 19:52:09 -0500
On Sunday, December 16, 2001, at 06:02 PM, Enigmarelle Development wrote:
What's the best way to get the path to the user's Application Support
Folder? Currently I'm using the below code, but I'm not sure if it's
reliable in all cases.
NSArray *libraryDirectories =
NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
NSUserDomainMask, FALSE);
NSString * appSupportFolder = [[libraryDirectories objectAtIndex: 0 ]
stringByAppendingString:(NSString *)@"/Application Support/"];
I don't know if there is a localizable answer, or if it is even an issue
(are those paths localized on non-english systems?). However, you
should probably use stringByAppendingPathComponent instead of
stringByAppendingString since it deals with the prescense of extra path
separators, or none, transparently and the resulting string should be
correct in both instances.
Jim