【发布时间】:2017-10-18 08:54:41
【问题描述】:
根据-[RLMCollectionChange modifications] 的文档,它返回The indices in the new version of the collection which were modified.。但是示例如下所示:
[tv beginUpdates];
[tv deleteRowsAtIndexPaths:[changes deletionsInSection:0] withRowAnimation:UITableViewRowAnimationAutomatic];
[tv insertRowsAtIndexPaths:[changes insertionsInSection:0] withRowAnimation:UITableViewRowAnimationAutomatic];
[tv reloadRowsAtIndexPaths:[changes modificationsInSection:0] withRowAnimation:UITableViewRowAnimationAutomatic];
[tv endUpdates];
UITableView 需要旧集合中的索引。这是不好的描述吗?
另一个问题是如何在新集合中获取索引?
调试器显示RLMCollectionChange 包含_indices.modifications 和_indices.modifications_new。看起来第一个是 -[RLMCollectionChange modifications] 返回的。第二个没有访问它的属性...
当然可以计算。这就是我们现在必须如何解决这个问题的方法。
【问题讨论】:
标签: ios objective-c uitableview realm