Re: NSApplicationSupportFolder
Re: NSApplicationSupportFolder
- Subject: Re: NSApplicationSupportFolder
- From: "Sean McBride" <email@hidden>
- Date: Mon, 27 Dec 2004 14:03:24 -0500
Shaun Wexler (email@hidden) on Mon, Dec 27, 2004 1:36 PM said:
>I think you have to hand-enter the non-localized string, such as:
>
>- (NSArray *)applicationSupportPaths
>{
> NSArray *searchPaths =
>NSSearchPathForDirectoriesInDomains(NSLibraryDirectory,
>NSUserDomainMask + NSLocalDomainMask, YES);
> NSMutableArray *applicationSupportPaths = [NSMutableArray
>arrayWithCapacity:[searchPaths count]];
> NSString *executableName = [[[NSBundle mainBundle] executablePath]
>lastPathComponent];
> NSString *pathComponent = [NSString stringWithFormat:@"Application
>Support/SKW Development/%@", executableName];
Hard coding paths is very bad. "Application Support" may change names in
the future. Using the FSFindFolder API is best and safest. See:
<http://developer.apple.com/documentation/Cocoa/Conceptual/
LowLevelFileMgmt/Tasks/LocatingDirectories.html>
--
"First they ignore you, then they attack you, then you win."
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden