• 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: Sean McBride <email@hidden>
  • Date: Thu, 22 Nov 2012 10:58:03 -0500
  • Organization: Rogue Research Inc.

On Wed, 21 Nov 2012 18:17:26 -0500, Tom Miller said:

>Sorry my bad! The warning states 'createDirectoryAtPath:attributes:' is
>depreciated. I was able to get rid of that window warning once the app
>launched, miss spelled something in my code. Though I'm still unable to
>save the imputed text to the XML. I can provide the entire set of code if
>needed to.

Tom,

Most path-based and non-NSError-returning file APIs are deprecated, and you should use URL+NSError methods instead:

createDirectoryAtURL:withIntermediateDirectories:attributes:error:

Also, using fileExistsAtPath: is rarely the right thing due to race conditions: it's possible the file didn't exist when you checked, then gets created by a different process before you get to create it.  Instead, just try to create it, and be ready for a returned error like 'already exists'.  See:

<https://developer.apple.com/library/mac/#documentation/security/conceptual/SecureCodingGuide/Articles/RaceConditions.html>

Cheers,

--
____________________________________________________________
Sean McBride, B. Eng                 email@hidden
Rogue Research                        www.rogue-research.com
Mac Software Developer              Montréal, Québec, Canada



_______________________________________________

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: NSFileManager - Incompatible persistent store
      • From: Tom Miller <email@hidden>
    • Re: NSFileManager - Incompatible persistent store
      • From: Shane Stanley <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>)

  • Prev by Date: Re: Tooltip with Custom bg color/image and text color
  • Next by Date: Re: NSRulerMarker question
  • Previous by thread: Re: NSFileManager - Incompatible persistent store
  • Next by thread: Re: NSFileManager - Incompatible persistent store
  • Index(es):
    • Date
    • Thread