开发者

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.

0

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜