Objective-C: sortDescriptorsDidChange argument?
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 ?
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.
精彩评论