Update custom views in one column of NSTableView based on editing a cell in another

37 Views Asked by At

In the first column of my view-based NSTableView, I have a custom NSView subclass. In the second column, there's an NSTextField.

Now I would like to adjust the drawing of the view in the first column based on when I start editing one of the text fields of the second column. I've tried setting a property on the custom view in tableView:viewForTableColumn:row:, but this doesn't work, as the table cells are only updated when I call reloadData on the table view, which in turn ends editing. To make this even more complicated, I'd like to adjust the drawing of the custom view not only in the row I'm currently editing, but for all the rows.

Any ideas how to achieve this?

1

There are 1 best solutions below

0
tajmahal On BEST ANSWER

Use reloadDataForRowIndexes:columnIndexes: to limit reloading to the first column.