Question

I have an NSArrayController which is bound to my NSTableView. The table view has the standard + / - buttons.

When I press the + button which triggers the add: action of the NSArrayController the new item in the list will automatically be selected, which prevents the user from editing the text in a NSTextField inside of the cell.

In IB the selection property of the table view multiple is not checked so multiple-selection shouldn’t even possible and is also not possible “by hand”.

I had to change the Highlight to None to work around the problem but now I am no longer able to delete individual columns, which is kind of fine in my case, but I am wondering how this could be solved, ideally without implementing a delegate (I prefer to just hook up stuff with the bindings for such a standard case).

highlight

Was it helpful?

Solution

If I understand correctly, every time you add an item to the NSArraycontroller, it gets selected in the NSTableview. Have you selected the preserveSelection and deselected the avoidEmptySelection of the NSArraycontroller? You also have to uncheck "selectInsertedObjects".

enter image description here

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