开发者

Objective-C: sortDescriptorsDidChange argument?

开发者 https://www.devze.com 2023-02-01 19:13 出处:网络
I don\'t get why sortDescriptorsDidChange takes an argument oldDescriptors if it is never used in the method.

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号