Adam
Adam

Reputation: 33126

Connect NSOutlineView/NSTreeView into an NSArrayController?

I'm trying to use Bindings with NSOutlineView.

I cannot see how to connect the "currently selected item" to anything else via Bindings

I've tried:

Upvotes: 1

Views: 2636

Answers (2)

Rob Keniger
Rob Keniger

Reputation: 46020

You don't use NSArrayController for an outline view, you use an NSTreeController. Then you can just bind to yourTreeController.selectedObjects if you want to access the selection.

NSArrayController is for use with NSTableView, NSTreeController is for use with NSOutlineView.

Apple has a great example showing how to use NSOutlineView with NSTreeController.

Upvotes: 4

Related Questions