【发布时间】:2014-03-18 21:31:35
【问题描述】:
每次我保存一个新对象时,它都会出现在我的UITableView 的顶部。如果希望它出现在不同的索引路径或不同的部分怎么办?
例如是否可以在以下位置插入新对象:
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[[self objectsFetched] count]-1 inSection:0];
或
NSIndexPath *indexPath = [NSIndexPath indexPathForRow:[[self objectsFetched] count]-1 inSection:1];
我可以使用NSMutableArrays 完成上述场景,但我如何使用 Core Data 来实现呢?
【问题讨论】:
-
退后一步。将对象保存到索引路径如何转换为核心数据中的位置
标签: core-data nsfetchedresultscontroller nssortdescriptor nsindexpath