Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

satyam90

macrumors regular
Original poster
Jul 30, 2007
242
0
Bangalore, India
I am using Cocoa framework with Obj C.
I have a NSTableView whose columns are bind to NSArrayController's arranged object's properties. Table view allows sorting of columns manually by user.
Its working fine.

Now, my NSArrayController's contents will be updated every 5 minutes. During update, old objects of array controller will be deleted and added again. So, automatically my table view contents changes accordingly. But its not maintaining the sorting order that it previously has.

Can some body suggest me how to update the table view without loosing the sorting order?
 
thanks for correcting me.

We don't have to call [NSTableView reloadData], because its already bind to NSArrayController and what ever data is in array controller, it will be shown in tableview.
my question is how to maintain the sorting....
 
Can you explain the behaviour a bit more? Are user's manually setting the sort order to their preference, then when the data changes it's reverting back to a default sort? Or are items being added to teh end (or beginning) of the table.

Generally you set bind the tableview's Sort binding to a NSSortDescripter somewhere.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.