Why does the row at the bottom of my outline view get deleted when I click the remove button rather than the one that is selected?

StackOverflow https://stackoverflow.com/questions/957344

Question

When I select a row in my outline view (connected to a NSTreeController) and click the remove button it doesn't delete the row that I have selected but actually deletes the row at the bottom of the table. For some more information here is my Connections for the Button:

http://snapplr.com/t1hm

and the Entity model:

http://snapplr.com/k6n3

If you need more info feel free to comment.

Was it helpful?

Solution

First, echoing Alex's comment, correct both bindings to be bound to the tree controller instead of the array controller.

Second, make sure you bind the outline view's “Selection Index Paths” binding to the tree controller's selectionIndexPaths property, so that the tree controller knows what's selected.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top