On Feb 11, 2016, at 13:26 , Michael de Haan <m...@comcast.net> wrote:
> 
> Currently, I obtain the “selection” of the treeController by implementing and 
> outlet to the controller, and using the “selectionIndexPaths” binding to 
> update a local variable which holds the selected range information. From 
> then, another function implements the highlight. It works, but it seems 
> awfully klunky.
> 
> Ideally, I would like to bind from IB the selection of the TreeController to 
> the local variable, but I cannot find a way to do this. Is this possible?

It’s not clear what you’re saying. NSTreeController supports a 
“selectionIndexPaths” binding that can be bound to a NSArray property via 
File’s Owner. [That sentence needs to be rephrased if you’re using Swift, or 
storyboards, but I’m assuming Obj-C and a XIB by default.] Your first quoted 
paragraph seems to say that this binding is bound, although it’s unclear how 
the outlet to the controller fits in.

The second quoted paragraph says you would like to do the thing that is 
apparently described by the first paragraph, hence my confusion. If it were 
bound in this way, you would still have “From then, another function implements 
…”, so isn’t that still clunky?

Or are you saying you’re currently observing the tree controller’s 
“selectionIndexPaths” *property* (not *binding*) using KVO or something else, 
and *that’s* what’s clunky?

Again, you can already do the thing you’re asking for. In IB, you can bind the 
NSTreeController’s “selectionIndexPaths” binding to something in a data model.

_______________________________________________

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

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

Reply via email to