Unique attribute in an entity (Core Data)
Unique attribute in an entity (Core Data)
- Subject: Unique attribute in an entity (Core Data)
- From: "Tony S. Wu" <email@hidden>
- Date: Fri, 17 Jun 2005 15:13:03 +0800
i have an attribute in an entity that i want to leave unique. so i subclass NSManagedObject, and in -validateKey: error: function i do a fetch and determine if the attribute exists in the entity or not. is this a good solution? if the entity already exists, what error should i return? also, if this entity is related to another entity on a to-many relationship, is it better to create an attribute on that other table to hold an ID, instead of using a reverse relationship? |
_______________________________________________
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