• 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: file references in CoreData
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: file references in CoreData


  • Subject: Re: file references in CoreData
  • From: "I. Savant" <email@hidden>
  • Date: Wed, 29 Oct 2008 07:02:51 -0400

On Oct 29, 2008, at 4:44 AM, Georg Seifert wrote:

I need to store references to local files in CoreData. What is the best solution for this. Just now I use plain paths but there has to be a better way.

I use the much-lauded BDAlias:

http://eschatologist.net/bDistributed.com/index.html

I encode it as data and store it that way. Using a transformable type as Dirkjan suggested, you can make it as convenient as -URL - setURL: and handle the conversion that way.

  URL <--> BDAlias <--> NSData

This way, you're referencing the file by its ID, not its location. If the location changes, your app still knows where it's at (unless it is removed from its original volume).

--
I.S.


_______________________________________________

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: file references in CoreData
      • From: Georg Seifert <email@hidden>
    • Re: file references in CoreData
      • From: "Sean McBride" <email@hidden>
References: 
 >file references in CoreData (From: Georg Seifert <email@hidden>)

  • Prev by Date: Re: file references in CoreData
  • Next by Date: Re: Message Forwarding Overhead / Performance
  • Previous by thread: Re: file references in CoreData
  • Next by thread: Re: file references in CoreData
  • Index(es):
    • Date
    • Thread