• 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: Unique items in Core Data models
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Unique items in Core Data models


  • Subject: Re: Unique items in Core Data models
  • From: mmalc crawford <email@hidden>
  • Date: Wed, 16 May 2007 12:59:36 -0700


On May 16, 2007, at 11:12 AM, Diederik Hoogenboom wrote:

One possible solution is to add a uuid attribute to your entity then have the following code in your awakeFrominsert:
CFUUIDRef UUID = CFUUIDCreate(kCFAllocatorDefault);
CFStringRef UUIDString = CFUUIDCreateString(kCFAllocatorDefault,UUID);
[self setValue:(NSString *)UUIDString forKey:@"uuid"];
CFRelease(UUID);
CFRelease(UUIDString);
This will generate a unique string to identify your managed object.


Managed objects already have a unique ID -- the objectID.
The issue is, how do you subsequently ensure uniqueness of a particular attribute...


mmalc

_______________________________________________

Cocoa-dev mailing list (email@hidden)

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


  • Follow-Ups:
    • Re: Unique items in Core Data models
      • From: "John R. Timmer" <email@hidden>
    • Re: Unique items in Core Data models
      • From: Diederik Hoogenboom <email@hidden>
References: 
 >Unique items in Core Data models (From: Keith Penrod <email@hidden>)
 >Re: Unique items in Core Data models (From: Diederik Hoogenboom <email@hidden>)

  • Prev by Date: Re: French number localization problem
  • Next by Date: Generation of a Waveform
  • Previous by thread: Re: Unique items in Core Data models
  • Next by thread: Re: Unique items in Core Data models
  • Index(es):
    • Date
    • Thread