Search code examples
objective-cmacoscocoanstableview

Edit specific row and column of NSTableView programmatically


I want to press a button, and have a specific box in my NSTableView change its value to something else. Is that possible? How can I do this?


Solution

  • Change the model.

    That is, get the object you want to change from your array controller, and then modify its attributes.

    If you're using a binding, the table will automatically reload the changed cell. If you're using the table view data source methods, just ask the table view to reload the changed cell using -reloadDataForRowIndexes:columnIndexes:.