Re: Validating unique objects in CoreData
Re: Validating unique objects in CoreData
- Subject: Re: Validating unique objects in CoreData
- From: "Sean McBride" <email@hidden>
- Date: Sat, 13 Feb 2010 19:32:15 -0500
Roland King (email@hidden) on 2010-02-13 22:06 said:
>That's not a horrible solution, except for the feeling that core data
>ought to let you do what you want without having to implement your own
>UUID cache.
I have found it useful, on many occasions, to add a 'uuid' attribute to
many of my Core Data entities. I set it in awakeFromInsert. I have
found NSManagedObject's objectID method largely useless since, as the
docs say, "if the receiver has not yet been saved, the object ID is a
temporary value that will change when the object is saved". I guess
that could be acceptable in some situations, but in a document-based
app, it's the user that decides when saving happens. I have also found
it odd that Core Data behaves like this, but I guess there is some SQL/
database reason for it all...
Sean
--
"None are more hopelessly enslaved than those who falsely believe they
are free." - Goethe
_______________________________________________
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