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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to [EMAIL PROTECTED]

Reply via email to