Validating a new entity in one-to-many relationships in Core Data
Validating a new entity in one-to-many relationships in Core Data
- Subject: Validating a new entity in one-to-many relationships in Core Data
- From: The Karl Adam <email@hidden>
- Date: Tue, 9 Aug 2005 16:49:29 -0400
For normal attributes and one-to-one relationships you get a
-validate<<Key>>:error: when you ask CoreData for the implementations
of the accessors, however on a one-to-many relationship you only
-add<<Key>>sObject: and -remove<<Key>>sObject:. The problem is that I
want to validate newly added Objects but there doesn't seem to be a
way to do so.
I want to not allow entities that match certain conditions to be
related to my Entity but I don't want it to fail silently which I
could do by just doing nothing in the above methods when those
conditions are met. If I use a validate<<Key>>:error: method then I
would have to test each related entity unnecessarily wasting time. Is
there a proper way to validate a newly added value to a one-to-many
relationship, preferably one that allows an NSError to be sent back
with the reason/conditions that made the relationship unacceptable?
-Karl
P.S. I sent this earlier today, apologies if it appears twice as I
have yet to see it turn up.
_______________________________________________
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