Re: Unique items in Core Data models
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