• 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: Diederik Hoogenboom <email@hidden>
  • Date: Wed, 16 May 2007 20:12:43 +0200

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.

- Diederik

--
Diederik Hoogenboom
Obvious Matter
http://www.obviousmatter.com



On 15-mei-2007, at 3:38, Keith Penrod wrote:

Is there a way to set it up so that one of the attributes for an Entity is a sort of identifier--that is, every Book has a title and only one book can exist for any given title--kind of like a NSDictionary? So, if the user tries to create a new item and name it the same title it will either ignore the request, combine the info for the two books, or raise an error message.
_______________________________________________


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:
40obviousmatter.com


This email sent to email@hidden


_______________________________________________

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: mmalc crawford <email@hidden>
References: 
 >Unique items in Core Data models (From: Keith Penrod <email@hidden>)

  • Prev by Date: Re: NSPopUpButtonCell -- I need an outlet to gain access to the button
  • Next by Date: Re: NSPopUpButtonCell -- I need an outlet to gain access to the button
  • Previous by thread: Re: Unique items in Core Data models
  • Next by thread: Re: Unique items in Core Data models
  • Index(es):
    • Date
    • Thread