• 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: NSFileManager - Incompatible persistent store
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSFileManager - Incompatible persistent store


  • Subject: Re: NSFileManager - Incompatible persistent store
  • From: Graham Cox <email@hidden>
  • Date: Mon, 26 Nov 2012 11:16:52 +1100

On 26/11/2012, at 9:44 AM, Tom Miller <email@hidden> wrote:

> Thank you! Though this didn't quite work. I'm getting an error response in
> the code telling me "No visible @interface for 'NSFileManger' declares the
> selector 'createDirectoryAtURL:attributes'. Included in this message is the
> code im playing with,


So, have you actually tried Sean's suggestion of using -createDirectoryAtURL:withIntermediateDirectories:attributes:error: ? You should also make your method -applicationSupportFolder return a NSURL not a path string.

There's no good reason for new code to be using a deprecated method, and sticking with paths instead of URLs is not a good long-term strategy. I've just spent a lot of time moving a bunch of older code from path strings to URLs and it's a lot of work, so unless you have to support a much older version of OS X, use NSURL now.

Also, as suggested, checking for the existence of the folder before trying to create it is considered a bad design pattern these days - the method will create the directory IF NECESSARY, and if not (i.e. it exists already) will gracefully return without error.


--Graham



_______________________________________________

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: 
 >NSFileManager - Incompatible persistent store (From: Tom Miller <email@hidden>)
 >Re: NSFileManager - Incompatible persistent store (From: Mike Abdullah <email@hidden>)
 >Re: NSFileManager - Incompatible persistent store (From: Tom Miller <email@hidden>)
 >Re: NSFileManager - Incompatible persistent store (From: Sean McBride <email@hidden>)
 >Re: NSFileManager - Incompatible persistent store (From: Tom Miller <email@hidden>)

  • Prev by Date: Re: dispatch queues are objects now .. right?
  • Next by Date: Re: Tooltip with Custom bg color/image and text color
  • Previous by thread: Re: NSFileManager - Incompatible persistent store
  • Next by thread: filterPredicate not effecting NSArrayController
  • Index(es):
    • Date
    • Thread