On 10 Feb 2010, at 9:44 PM, Paul Johnson wrote:
> I have a function "- (NSString *)applicationSupportFolder" that
> returns the desired folder name, properly localized. I call this
> function and then use NSFileManager to check for the existence of the
> folder. Because there can be a file (NOT a folder) already bearing the
> folder name, I need to handle that possibility. Everything I've found
> on the internet just ignores this case.
You're way overthinking this.
1. "Application Support" is a standard directory name in Mac OS X, and it's
always the same name regardless of localization; as with other standard
directory names, the Finder localizes the name before displaying it.
2. Look for the function NSSearchPathForDirectoriesInDomains(). Pass the
constant NSApplicationSupportDirectory. Consider which domains you want to
cover. Heed the warning that the paths the function returns may not describe
directories that exist yet.
For a cheap example, create a dummy Core Data, non-document project, and crib
the Application Support algebra from the application delegate.
— F
_______________________________________________
Cocoa-dev mailing list ([email protected])
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com
This email sent to [email protected]