[英]Should there be a UITableView performance difference between NSFetchedResultsController and executeFetchRequest?
[英]NSFetchedResultsController performance with UITableView index
我正在学习NSFetchedResultsController
,有一件事使我感到困惑。 NSFetchedResultsController
与UITableView
结合使用,有助于提高性能,并根据UITableView
当前显示的内容来计算要提取的记录。
当您使用UITableView
索引(例如Addressbook应用程序中的首字母)时,这是否意味着将加载整个数据集以确定所有节的所有首字母?
使用索引不会阻止NSFetchedResultsController
对其加载的内容进行明智的选择吗?
NSFetchedResultsController
构建从它的索引sectionKeyPath
。 可以假设要获取此值,将执行提取操作以仅获取此键的唯一值,而不获取接近完整数据集的任何值。 例如,它可以做一些类似的事情,例如创建一个NSFetchRequest
,其结果类型为NSDictionaryResultType
, returnsDistinctResults
设置为YES
,并且propertiesToFetch
仅设置为sectionKeyPath
。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.