• 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, array controller, and add:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Core data, array controller, and add:


  • Subject: Re: Core data, array controller, and add:
  • From: mmalc crawford <email@hidden>
  • Date: Wed, 1 Nov 2006 20:01:52 -0800


On Nov 1, 2006, at 1:51 PM, Dale Schack wrote:

I now want to intercept the point where the newly created Child is added to its Parent, as I need to update a non-standard attribute that maintains ordering. I had thought to perform this in the Parent relationship methods (e.g. addChildObject:)
However, this method is not being called by the default NSArrayController add: method. Do I need to create a custom NSArrayController to ensure that addChildObject: is called on the Parent? Or am I missing something basic here?


This is (unfortunately) due to a (known) bug in NSArrayController; it does not invoke custom accessor methods.

You can work around this if you can introduce '.self' into the keypath, for example:

If the contentSet of your detail array controller is bound to
	[MasterArrayController].selection.children

then change it to
	[MasterArrayController].selection.self.children

mmalc

_______________________________________________
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


  • Follow-Ups:
    • Re: Core data, array controller, and add:
      • From: Dale Schack <email@hidden>
References: 
 >Core data, array controller, and add: (From: Dale Schack <email@hidden>)

  • Prev by Date: Re: swizzling a class to a subclass inorder to add ivars (& methods) to a class
  • Next by Date: Re: swizzling a class to a subclass inorder to add ivars (& methods) to a class
  • Previous by thread: Core data, array controller, and add:
  • Next by thread: Re: Core data, array controller, and add:
  • Index(es):
    • Date
    • Thread