Re: Core Data and unique IDs
Re: Core Data and unique IDs
- Subject: Re: Core Data and unique IDs
- From: Stefan <email@hidden>
- Date: Sun, 30 Jul 2006 22:20:25 +0200
Am 30.07.2006 um 21:37 schrieb Mike Zornek:
On 7/30/06 12:09 AM, "email@hidden" <email@hidden> wrote:
Just make a common super entity that has a uuid field that holds a
string value.
In the awakeFromInsert method, set the value of the uuid field using
CFUUID and its string uuid method.
It will then persist in all sub entities (and as long as they
subclass from that class)
You can then use it sort of like a globally unique-primary key of
sorts.
Its very useful in my opinion.
This is exactly what I do and it works fine. Originally, I was
using the
built in uuid field in Core Data but the problem with that is it is
not set
until an object is saved to the store.
Thanks for all replies! Good to know, how to do it.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Cocoa-dev mailing list (email@hidden)
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden