Re: Unique data in Core Data?
Re: Unique data in Core Data?
- Subject: Re: Unique data in Core Data?
- From: Paul Collins <email@hidden>
- Date: Wed, 21 Jun 2006 09:57:45 -0700
On Jun 21, 2006, at 8:38 AM, Andrew Kinnie wrote:
I am curious whether there is a quick and easy way to create unique
data in a Core Data app.
If you're looking for something like the "unique" flag in MySQL, I'm
not aware of any equivalent in Core Data. But there is a validation
system you can put your own methods in, so you can programmatically
ensure the uniqueness of new entries. Best thing I can think of is to
fetch with the new string and see if it exists. Read the "Validation"
section of Core Data Programming Guide.
FYI, for a serialized attribute (1, 2, 3, ...) I keep a separate, 1-
entry table with integer attributes like "nextID" with the next
serial number to use for that persistence stack.
Paul Collins
_______________________________________________
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