gpt4 book ai didi

objective-c - 排序 NSFetchedResultsController 的部分数组

转载 作者:搜寻专家 更新时间:2023-10-30 20:22:33 24 4
gpt4 key购买 nike

有没有办法对 NSFetchedResultsController 的 sections 属性进行排序?假设我不希望我的部分按字母顺序升序排序,而是降序排序。或者甚至可能不是按字母顺序排列,而是按部分中的行数升序排列。

我可以想象直接对数组排序不是一个好主意,因为 NSFetchedResultsController 为我创建并填充了它..

最佳答案

"1) 使用 transient 属性连接要排序的属性和将显示为标题并在 sectionNameKeyPath 和中指定的属性

2) 然后使用 UITableViewDelegate titleForHeaderSection 从值中提取名称。”

更多在这里: http://machine501.com/blog/2011/04/26/uitableview-section-sorting-a-hack/

关于objective-c - 排序 NSFetchedResultsController 的部分数组,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/6558791/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com