1

I don't get why sortDescriptorsDidChange takes an argument oldDescriptors if it is never used in the method.

- (void)tableView:(CPTableView)aTableView sortDescriptorsDidChange:(CPArray)oldDescriptors {
   [result sortUsingDescriptors:[aTableView sortDescriptors]];
   [aTableView reloadData];
}

What am I missing ?

aneuryzm
  • 63,052
  • 100
  • 273
  • 488

1 Answers1

1

sortDescriptionDIdChange is a delegate, so you can implement your own behavior for it.

For example, you could use oldDescription along with the new description to manually calculate the changes and provide a nice animation for them. Or to implement specific behavior if the order didn't change etc. etc.

jsadfeew
  • 2,247
  • 1
  • 18
  • 25
  • Is sortDescriptionDidChange automatically invoked when I click on table headers to order the column ? I've only been able to call it explicitly in the code so far. If I click on the column headers, it doesn't work. – aneuryzm Dec 26 '10 at 14:13