• 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: Core Data and unique IDs
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core Data and unique IDs


  • Subject: Re: Core Data and unique IDs
  • From: Óscar Morales Vivó <email@hidden>
  • Date: Sun, 30 Jul 2006 00:23:49 -0400

IIRC Core data objects already have a private UID set, used internally. I wouldn't recommend using it though.

On Jul 30, 2006, at 00:09 , email@hidden wrote:

 Stefan wrote:

Do we have a unique ID property for entities?

Although I currently don't need it, I wonder how I could move an entity from
system A to system B using DO. My idea would be to add a globally unique system ID
to each system and add this system ID to each entity. Each entity, which moves from system A
to system B would know, if it is locally maintained or copy from a remote destination.


Well, not really importent. Does a best practice exist? _______________________________________________
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.



Andre email@hidden



_______________________________________________
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

_______________________________________________ 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
References: 
 >Core Data and unique IDs (From: Stefan <email@hidden>)
 >Re: Core Data and unique IDs (From: email@hidden)

  • Prev by Date: Re: Core Data and unique IDs
  • Next by Date: How to use a DataSource for NSLevelindicatorCell?
  • Previous by thread: Re: Core Data and unique IDs
  • Next by thread: Re: Core Data and unique IDs
  • Index(es):
    • Date
    • Thread