Cache CoreData objects in UITableView for performance?
I've been wondering about the performance characteristics of using CoreData as a data source in a UITableView directly. So, suppose I'm displaying a bunch of data in a UITableView that I'm retrieving from my CoreData store when needed. Does retrieving 开发者_如何学运维this data on demand incur a particularly high performance cost? In other words, does it make sense (from a performance standpoint) to cache retrieved items from the store, and reference that set when displaying my UITableView data as opposed to going off to CoreData every time? I'm sure there's some sort of performance gain to be had here, but I don't have any intuition about how large or small it might be. Anyone?
You should consider using NSFetchedResultsController
. It's designed to maximize performance while minimizing memory usage for exactly your situation.
精彩评论