How to make a button delete a row with basic data as an outline?

I have a generic view with two objects displayed inside it, so it's connected to an NSTreeController. I created a button and bound it to the NSTreeController 'canRemove' key under Accessibility> Enabled. But when you start the application, the button is always disabled, even if a row is selected in the Outline window. How can this be committed to work and delete the selected row in Path view?

0


a source to share


2 answers


You need to set the target of the button to the tree controller and its action to remove:

. It's easy in IB: right-click on the tree controller, then drag it from the action remove:

(specifically, from the circle at the right edge of the row) to the Delete button.



+5


a source


Is "editable" allowed on the tree controller?



+3


a source







All Articles