views:

238

answers:

3

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.

+3  A: 

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]];
Vladimir
+1  A: 

Usually, updating the whole table via reloadData: is the correct design pattern. Why are you averse to doing so? Is it for efficiency reasons, or are you relying on the table to save some state and reloading all the data interferes with that? The latter is usually a sign that you need to rethink your architecture.

Amorya
I want to do this because of efficiency. Like I need to update 8-10 cells per second it this case I dont want the whole table to be updated over and again !
Omayr