views:

75

answers:

2

I have an outline view with 2 entities being displayed inside it so It is connected to a NSTreeController. I have created a button and binded it to the NSTreeController's Controller Key 'canRemove' under Availability>Enabled. But when you run the App the button is always Disabled even when a row is selected in the Outline View. How can this be fixed to work and remove the selected row in the Outline view?

+5  A: 

You need to set the button's target to the tree controller, and its action to remove:. This is easy in IB: Right-click on the tree controller, then drag from its remove: action (specifically, from the circle at the right edge of the row) to the Remove button.

Peter Hosey
Thanks, I forgot to do that, Did it now but it still does not work, Here's a screen shot of the bindings and connections for the button, hope it helps solve the problem: http://snapplr.com/qsa5
Joshua
That looks right. What do you mean it “does not work”?
Peter Hosey
What I mean is that the button is disabled and will not allow you to click it.
Joshua
+3  A: 

Is 'editable' enabled on the tree controller?

Marc Charbonneau
That fixed it Thanks!
Joshua