• 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: mmalc Crawford <email@hidden>
  • Date: Tue, 23 Feb 2010 13:17:37 -0800

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 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.
>
<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 implemented set mutator methods for a relationship as described in “Custom To-Many Relationship Accessor Methods,” and have bound thecontentSet binding of an NSArrayController instance to a relationship (as illustrated by the Employees array controller in NSPersistentDocument Core Data Tutorial), but the set mutator methods are not invoked when you add objects to and remove objects from the array controller.

Cause: This is a bug.

Remedy: You can work around this by adding self to the contentSet binding's key path. For example, instead of binding to [Department Object Controller].selection.employees, you would bind to [Department Object Controller].selection.self.employees.


mmalc

_______________________________________________

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: Jerry Krinock <email@hidden>
    • Re: Core Data: Custom to-many relationship setter not being invoked
      • From: Ken Tabb <email@hidden>
References: 
 >Core Data: Custom to-many relationship setter not being invoked (From: Ken Tabb <email@hidden>)

  • Prev by Date: Sheet not appearing normally...the first time
  • Next by Date: Re: NSPredicateEditor losing nextKeyView
  • 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