Improving Performance

A reduced fetched results size helps improve performance. Beyond setFetchBatchSize, there are other NSFetchRequest options you can use to minimize the result set. Not all options are appropriate to all situations:

image Use setFetchLimit and setFetchOffset to reduce fetch results to a specific number of rows starting from a specific point. This may, for example, be appropriate for an application using a Page View Controller to display information. Each page could have a different fetch offset and possibly the same fetch limit.

Use setPredicate to reduce the result set according to the supplied predicate. If you’re supplying a ...

Get Learning Core Data for iOS: A Hands-On Guide to Building Core Data Applications now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.