• 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: Creating an Application Support folder
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Creating an Application Support folder


  • Subject: Re: Creating an Application Support folder
  • From: Fritz Anderson <email@hidden>
  • Date: Thu, 11 Feb 2010 22:31:42 -0600

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@hidden)

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:

This email sent to email@hidden

References: 
 >Creating an Application Support folder (From: Paul Johnson <email@hidden>)

  • Prev by Date: Re: What classes have -init?
  • Next by Date: Replacing model objects using an NSArrayController
  • Previous by thread: Re: Creating an Application Support folder
  • Next by thread: Re: Creating an Application Support folder
  • Index(es):
    • Date
    • Thread