How to update NSTableView without using -reloadData?

Omayr picture Omayr · Oct 20, 2010 · Viewed 13.1k times · Source

I am new to the Mac. I am trying to update a particular cell in NSTableView without using -reloadData, as -reloadData updates the whole table. I have tried everything but all was in vain. I am trying to do something similar to what we used to do in CListCtrl in MFC or in .NET.

Answer

Vladimir picture Vladimir · Oct 20, 2010

Have a look at reloadDataForRowIndexes:columnIndexes: method. To update a single cell the following should work:

[yourTable reloadDataForRowIndexes:[NSIndexSet indexSetWithIndex:row]  
                     columnIndexes:[NSIndexSet indexSetWithIndex:column]];