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 (Cocoa-dev@lists.apple.com)

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:
http://lists.apple.com/mailman/options/cocoa-dev/archive%40mail-archive.com

This email sent to arch...@mail-archive.com

Reply via email to