• 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: Dale Schack <email@hidden>
  • Date: Wed, 1 Nov 2006 22:56:34 -0700


mmalc,

Works like a charm.  Thanks.

As an aside, I see that this is covered in the Core Data FAQ. My apologies for not having read the FAQ prior to posting the question.

Dale

On 1-Nov-06, at 9:01 PM, mmalc crawford wrote:


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
References: 
 >Core data, array controller, and add: (From: Dale Schack <email@hidden>)
 >Re: Core data, array controller, and add: (From: mmalc crawford <email@hidden>)

  • Prev by Date: distinctUnionOfSets operator with mutableSetValueForKeyPath:?
  • Next by Date: Re: Open my Application via safari
  • Previous by thread: Re: Core data, array controller, and add:
  • Next by thread: Prevent DVD Player launch
  • Index(es):
    • Date
    • Thread