Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-23 Thread Ken Tabb
Adding is via a button going to an Employee array controller's -add. In the interface there are 2 array controllers (1 for Departments, 1 for Employees). The Employees controller is set to use the selection in the Departments controller (i.e. showing the subset belonging to the selected

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-23 Thread Jeffrey Oleander
On Tue, 2010/02/23, Ken Tabb k.j.t...@herts.ac.uk wrote: From: Ken Tabb k.j.t...@herts.ac.uk Subject: Re: Core Data: Custom to-many relationship setter not being invoked To: Quincey Morris quinceymor...@earthlink.net Cc: cocoa-dev cocoa-dev@lists.apple.com Date: Tuesday, 2010 February 23, 03

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-23 Thread Ken Tabb
Hi Jeffrey, well in the model, the Department's relationship is defined as 'employees', and when I copy to clipboard from the model (as per Xcode's Design - Data Model - copy to clipboard), everything in the boilerplate code is employees (plural). If I edit them to - addEmployeeObject /

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-23 Thread Quincey Morris
On Feb 23, 2010, at 01:20, Ken Tabb wrote: Adding is via a button going to an Employee array controller's -add. In the interface there are 2 array controllers (1 for Departments, 1 for Employees). The Employees controller is set to use the selection in the Departments controller (i.e.

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-23 Thread Ken Tabb
On 23 Feb 2010, at 6:19, Quincey Morris wrote: Adding is via a button going to an Employee array controller's -add. In the interface there are 2 array controllers (1 for Departments, 1 for Employees). The Employees controller is set to use the selection in the Departments controller (i.e.

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-23 Thread Quincey Morris
On Feb 23, 2010, at 11:08, Ken Tabb wrote: These last 2 theories were what I presumed, but you know how desperate the theories start to become after a while :) Yeah, I know how that goes. It sounds like it's bug reporter time. You're leveraging a free method of getting your relationships

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-23 Thread mmalc Crawford
On Feb 22, 2010, at 2:59 pm, Ken Tabb wrote: 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

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-23 Thread Ken Tabb
On 23 Feb 2010, at 9:17, mmalc Crawford wrote: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/Core Data/Articles/cdTroubleshooting.html#//apple_ref/doc/uid/TP40002320-SW3 Custom relationship set mutator methods are not invoked by an array controller Problem: You have

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-23 Thread Jerry Krinock
On 2010 Feb 23, at 13:17, mmalc Crawford wrote: http://developer.apple.com/mac/library/documentation/Cocoa/Conceptual/CoreData/Articles/cdTroubleshooting.html#//apple_ref/doc/uid/TP40002320-SW3 Custom relationship set mutator methods are not invoked by an array controller Problem: You have

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-23 Thread Kyle Sluder
On Tue, Feb 23, 2010 at 2:32 PM, Jerry Krinock je...@ieee.org wrote: Furthermore, I've never been able to find any documentation stating that Cocoa is required to invoke the set mutator method(s).  Invoking the setEmployees: method, which both Ken and I have noted *does* happen, is a

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-23 Thread Jerry Krinock
On 2010 Feb 23, at 14:52, Kyle Sluder wrote: On Tue, Feb 23, 2010 at 2:32 PM, Jerry Krinock je...@ieee.org wrote: Furthermore, I've never been able to find any documentation stating that Cocoa is required to invoke the set mutator method(s). Invoking the setEmployees: method, which both

Core Data: Custom to-many relationship setter not being invoked

2010-02-22 Thread Ken Tabb
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

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-22 Thread Keary Suska
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

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-22 Thread Jerry Krinock
On 2010 Feb 22, at 14:59, Ken Tabb wrote: 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 I believe that Core Data does a wholesale replacement. Try overriding

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-22 Thread Ken Tabb
Hi Jerry, thanks for the reply. You're right, implementing -setEmployees works like a charm. There's no mention of it in the CoreData.pdf though, that I can find. I will try to use KVO observations, but my purpose is actually to maintain a linked list of employees (OK the Department /

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-22 Thread Ken Tabb
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

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-22 Thread Jerry Krinock
On 2010 Feb 22, at 15:53, Ken Tabb wrote: I will try to use KVO observations, but my purpose is actually to maintain a linked list... If I recall correctly, the reason why I use custom setters instead of KVO sometimes is because I need a notification *before* the change actually occurs.

Re: Core Data: Custom to-many relationship setter not being invoked

2010-02-22 Thread Quincey Morris
On Feb 22, 2010, at 15:54, Ken Tabb wrote: 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; -