Re: file references in CoreData
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