Using Keys to create Unique Attributes in CoreData?
Using Keys to create Unique Attributes in CoreData?
- Subject: Using Keys to create Unique Attributes in CoreData?
- From: Colin Cornaby <email@hidden>
- Date: Sat, 6 Aug 2005 14:17:17 -0700
I know I'm using some terminology already in CoreData, but I think
I'm using it for a different meaning, so I'll explain...
When I worked with Microsoft SQL/ASP all the way back in 2000, you
could specify a key value in the schema for an entity. For example, I
was coding a job database. A person could view jobs and send in their
resumes. In the database, the job entity had it's job id set up as a
key value (job id was an attribute of the job entity). That is, the
database would only allow there to be one job entity with that job
id. NSDictionary is something very similar in a way. All keys in an
NSDictionary must be unique, if you try to add a object with a key
value that already exists in the dictionary, the old one is overwritten.
Does CoreData have any way to do this? I have two values in an
entity, and I want to make sure no other entity in the database has
those two same values. I tried doing this progmatically with fetch
requests and deleting manually but this was dog slow. I went from
being able to handle around 800 entity adds in a second to about 800
in ten seconds. Is there a fast "good" way to do this, or even a
built in way?
---------------------------
Colin Cornaby - http://gomac.blogspot.com/
Carpe Stellarem - Lead Programmer, ProToys - http://carpestellarem.com
Macintosh Specialist - University of Portland - htttp://up.edu
_______________________________________________
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