• 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
NSTreeController Content Array as index accessor object -- what is the <Key>?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

NSTreeController Content Array as index accessor object -- what is the <Key>?


  • Subject: NSTreeController Content Array as index accessor object -- what is the <Key>?
  • From: Stuart Malin <email@hidden>
  • Date: Sat, 21 Feb 2009 13:24:28 -1000

I'm confused using an NSTreeController. I have a node object that implements indexed accessors. This works. For I have an OutlineView that is bound to a nib instantiated instance of TreeController. My problem is this:

First, I bound the TreeController's Content Array to an instance of MSMutableArra in my AppController (setting in IB the AppController as the "bind to" and setting the Model Key Path to the name of the mutable array ivar. This works partly -- the Outline View doesn't display new nodes that I add to the mutable array.

I think to myself: but of course: NSMutableArray is not KVO-compliant (right?)

So I constructed a class that has a mutable array as a backing store, and expose the KVC indexed accessors for a to-many object.

Presently, when I run, an exception is generated:
Cannot create NSArray from object <GRIndexArray: 0x1417b0> of class GRIndexArray


The Cocoa Bindings Programming Topic says:

"The contentArray binding is bound to an NSArray or an object that implements the appropriate array indexed accessor methods."

But... I'm not sure what <Key> to use. How would NSTreeController know this? Where in IB do I set? Or might this be derived from the class name?

As you can see, I'm quite confused.
My apologies if this question should be answered in the docs, which I am consulting, but am just not seeing my way.
TIA.






_______________________________________________

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: NSTreeController Content Array as index accessor object -- what is the <Key>?
      • From: Quincey Morris <email@hidden>
  • Prev by Date: NSOutlineView : Incorrect Drag and Drop drawing?
  • Next by Date: Help with recursive includes
  • Previous by thread: Re: NSOutlineView : Incorrect Drag and Drop drawing?
  • Next by thread: Re: NSTreeController Content Array as index accessor object -- what is the <Key>?
  • Index(es):
    • Date
    • Thread