jimt
jimt

Reputation: 2010

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?

Upvotes: 2

Views: 470

Answers (1)

rid
rid

Reputation: 63610

You should consider using NSFetchedResultsController. It's designed to maximize performance while minimizing memory usage for exactly your situation.

Upvotes: 1

Related Questions