I wont to sort a table view by a date column (“dasDatum”).
I know I can do it by clicking the header cell and using tableView_sortDescriptorsDidChange_.
But the table starts without sorting and new data are added at the end of the table. To avoid it I’m looking for a programmatically solution.
My attempts are leading to nowhere.
To add new data for example:
property SortDescriptorClass: class "NSSortDescriptor"
property NSArrayClass: class "NSArray"
set NewData to {derTermin:derTermin, derKalender:derKalender,dasDatum:dasDatum}
tDataSource's addObject_(NewData)
set theDescriptor to SortDescriptorClass's sortDescriptorWithKey_ascending_("dasDatum",true)
log theDescriptor -- (dasDatum, ascending, compare:)
tTableView's setSortDescriptors_(NSArrayClass's arrayWithObjects_(theDescriptor,missing value))
tTableView's reloadData()