Re: Find the 'Application Support' folder
Re: Find the 'Application Support' folder
- Subject: Re: Find the 'Application Support' folder
- From: Charles Srstka <email@hidden>
- Date: Tue, 12 Oct 2004 11:21:36 -0500
On Oct 11, 2004, at 7:40 PM, Sean McBride wrote:
Steven Kramer (email@hidden) on Sun, Oct 10, 2004 16:38
said:
I want to find the 'Application Support' folder from my app. What is
the
best way to do this? Any example code?
NSFileManager* fileManager = [NSFileManager defaultManager];
NSMutableString* library = [[[NSSearchPathForDirectoriesInDomains
(NSLibraryDirectory, NSUserDomainMask, YES) anyObject] mutableCopy]
autorelease]; /// (where anyObject returns... any object!)
library = [[[library stringByAppendingPathComponent: @"Application
Support"] mutableCopy] autorelease];
This is still hardcoding the string "Application Support". As others
have said, using one of the FindFolder APIs is better.
FSFindFolder works, but I have always wondered why Apple hasn't built
in a Cocoa API for accessing these folders. Having to go through Carbon
to do this is kind of annoying.
Yes, there are third-party categories that give this functionality, but
it really should be part of the default API.
Charles
_______________________________________________
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