Re: Core Data: Custom to-many relationship setter not being invoked
Re: Core Data: Custom to-many relationship setter not being invoked
- Subject: Re: Core Data: Custom to-many relationship setter not being invoked
- From: Ken Tabb <email@hidden>
- Date: Mon, 22 Feb 2010 23:54:20 +0000
Hi Keary,
thanks for your reply. Yep I implemented all 4, as per the Design ->
Data Model -> Copy to clipboard template, i.e.
- (void)addEmployeesObject:(Employee *)value;
- (void)removeEmployeesObject:(Employee *)value;
- (void)addEmployees:(NSSet *)value;
- (void)removeEmployees:(NSSet *)value;
However if I implement -setEmployees as per Jerry's e-mail (and
seemingly contravening the advice in the Core Data Programming Guide),
then it works like a charm :-/
Thanks for taking the time to help,
Ken
On 22 Feb 2010, at 11:21, Keary Suska wrote:
On Feb 22, 2010, at 3:59 PM, Ken Tabb wrote:
Hi folks,
I'm clearly doing something daft but unable to see the error of my
ways.
Distilling my problem down into the Department & Employees example,
both are custom NSManagedObject subclasses, each with an inverse to-
many / to-one relationship as you'd expect. My problem is that
Department's custom -awakeFromInsert gets called, yet its -
addEmployeesObject and -addEmployees methods don't ever get called.
If I add employees in the app, it all works swimmingly, but my
custom accessors aren't ever used.
Do you implement both the add<key> *and* remove<key>? The framework
might require both to assume compliance.
HTH,
Keary Suska
Esoteritech, Inc.
"Demystifying technology for your home or business"
- - - - - - - - - -
Dr. Ken Tabb
Mac & UNIX Developer - Health & Human Sciences
Machine Vision & Neural Network researcher - School of Computer Science
University of Hertfordshire, UK
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please 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