• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Core Data: Custom to-many relationship setter not being invoked
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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: Tue, 23 Feb 2010 09:20:24 +0000

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 dept).

Adding and deleting Departments and Employees is fine (everything gets hooked up / added / deleted properly), and if I look in the XML Core Data store, all is well. It's just my custom accessors (the 4 mentioned below) don't get used, whereas -setEmployees does.

Do you reckon it's because the adding is happening from the Employee side of things rather than the Department side of things? Shouldn't both sides have their accessor methods called (thanks to the inverse relationship)?

I can't believe it's relevant, but the Department's 'employees' relationship is mandatory, as is the inverse relationship.

Weird isn't it :)

Ken

On 23 Feb 2010, at 2:34, Quincey Morris wrote:

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;
- (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 :-/

There's something else going here, though it isn't clear what. One thing you haven't said is *how* you're adding employees. Could you show the code that does this?



_______________________________________________

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:
@herts.ac.uk


This email sent to email@hidden

- - - - - - - - - - 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


  • Follow-Ups:
    • Re: Core Data: Custom to-many relationship setter not being invoked
      • From: Quincey Morris <email@hidden>
    • Re: Core Data: Custom to-many relationship setter not being invoked
      • From: Jeffrey Oleander <email@hidden>
References: 
 >Core Data: Custom to-many relationship setter not being invoked (From: Ken Tabb <email@hidden>)
 >Re: Core Data: Custom to-many relationship setter not being invoked (From: Keary Suska <email@hidden>)
 >Re: Core Data: Custom to-many relationship setter not being invoked (From: Ken Tabb <email@hidden>)
 >Re: Core Data: Custom to-many relationship setter not being invoked (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: progressbar animation not working on snow leopard
  • Next by Date: Deprecated APIs
  • Previous by thread: Re: Core Data: Custom to-many relationship setter not being invoked
  • Next by thread: Re: Core Data: Custom to-many relationship setter not being invoked
  • Index(es):
    • Date
    • Thread