I’ve been using Core Data in my project and I’ve been relying on its data faulting system to return cached data, however I’ve been running into some performance issues especially when displaying data in a UITableView that configures its view based on this fetched data.
It basically fetches some NSManagedObject instances through their unique ID, and sums up a value stored in an NSNumber. It’s doing this for around 40 different objects inside a for loop and it does this every time the UITableView is reloaded.
Is there any suggested way to listen for changes in Core Data NSManagedObjects or a way to cache data at my level, or should I rely on data faulting and it’s just that I’m doing something wrong?
If you could point me to a good pattern to handle this situations I’d be immensely thankful.
NSFetchedResultsController provides a nice mechanism for handling faulting and providing a clean interface with UITableView. Use Instruments and Time Profiler to get a good picture of where specifically your performance issues lie.