Disable automatic row selection after filling NSTableView

I have two NSTableViews filled with underlying data that are linked using bindings. When a row is selected in NSTableView1, NSTableView2 is populated and the first row is selected. I have registered an NSArrayController that matches NSTableView2 with KVO on its selectIndex. This means that when a row is selected in NSTableView2, the method runs. My problem is that when a row is selected in NSTableView1 then the first row in NSTableView2 is selected, starting the method. I'd like to be able to select a row in NSTableView1 and populate NSTableView2 without having a row automatically selected in NSTableView2. How is this achieved?

+1


a source to share


2 answers


It doesn't matter that you are using Core Data. This is a binding issue.



Disable "Avoids empty empty" on the array controller.

+8


a source


This solution worked for me Xcode 8.3.3.

I have checked the "Empty" box:



enter image description here

0


a source







All Articles