• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag
 

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Find the 'Application Support' folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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
  • Follow-Ups:
    • Re: Find the 'Application Support' folder
      • From: John Stiles <email@hidden>
References: 
 >Re: Find the 'Application Support' folder (From: Steven Kramer <email@hidden>)
 >Re: Find the 'Application Support' folder (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: NSButtonCells in Custom View
  • Next by Date: Re: Find the 'Application Support' folder
  • Previous by thread: Re: Find the 'Application Support' folder
  • Next by thread: Re: Find the 'Application Support' folder
  • Index(es):
    • Date
    • Thread