• 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: Ken Thomases <email@hidden>
  • Date: Sat, 13 Feb 2010 07:58:04 -0600

On Feb 12, 2010, at 10:17 AM, Sean McBride wrote:

> On 2/10/10 10:44 PM, Paul Johnson said:
>
>> I'm trying to find a best way to create the Application Support
>> folder. I'm rather new at Cocoa so it's taking me a while to do even
>> this simple thing.
>
> Since you're new to Cocoa, I'm guessing all the other replies have
> probably provided the real answers you need.
>
> However, I just tried a little test.  I renamed my App Support folder
> then did this:
>
> NSSearchPathForDirectoriesInDomains (
>  NSApplicationSupportDirectory,
> 		NSUserDomainMask, YES);
>
> It just returned the path, but did not create the folder.
>
> This is in contrast to FSFindFolder() which can optionally (attempt to)
> create the folder for you.
>
> So although unlikely, be prepared for the folder to not exist.

If you're targeting Snow Leopard or later, the new recommended routines are:

-[NSFileManager URLForDirectory:inDomain:appropriateForURL:create:error:]
-[NSFileManager URLsForDirectory:inDomains:]

The former can be told to create the directory for you.

Regards,
Ken

_______________________________________________

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

  • Follow-Ups:
    • Re: Creating an Application Support folder
      • From: "Sean McBride" <email@hidden>
References: 
 >Creating an Application Support folder (From: Paul Johnson <email@hidden>)
 >Re: Creating an Application Support folder (From: "Sean McBride" <email@hidden>)

  • Prev by Date: Re: Validating unique objects in CoreData
  • Next by Date: Re: Connected Objects being allocated
  • Previous by thread: Re: Creating an Application Support folder
  • Next by thread: Re: Creating an Application Support folder
  • Index(es):
    • Date
    • Thread