Skip navigation.
 
mlRe: Find the 'Application Support' folder
FROM : Charles Srstka
DATE : Tue Oct 12 18:21:36 2004

On Oct 11, 2004, at 7:40 PM, Sean McBride wrote:

> Steven Kramer (<email_removed>) 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

Related mailsAuthorDate
mlFind the 'Application Support' folder Peter Karlsson Oct 9, 16:38
mlRe: Find the 'Application Support' folder Sherm Pendley Oct 9, 17:34
mlRe: Find the 'Application Support' folder David Reed Oct 9, 17:57
mlRe: Find the 'Application Support' folder Finlay Dobbie Oct 9, 18:11
mlRe: Find the 'Application Support' folder Steven Kramer Oct 10, 22:38
mlRe: Find the 'Application Support' folder Sean McBride Oct 12, 02:40
mlRe: Find the 'Application Support' folder Charles Srstka Oct 12, 18:21
mlRe: Find the 'Application Support' folder John Stiles Oct 12, 18:40
mlRe: Find the 'Application Support' folder stephane sudre Oct 12, 19:04
mlRe: Find the 'Application Support' folder John Stiles Oct 12, 19:36
mlRe: Find the 'Application Support' folder Rosyna Oct 12, 20:43
mlRe: Find the 'Application Support' folder Greg Hurrell Oct 18, 01:31
mlRe: Find the 'Application Support' folder John Stiles Oct 18, 18:03