Performing the Fetch
Create a new fetched results controller for each query. Initialize it with the fetch request, the context, and the section name key path. You can always use @"section" and make sure to define a section attribute for the objects; often, the needs are not complex.
The controller also uses a cache name parameter. Caching reduces overhead associated with producing data that’s structured with sections and indexes. Multiple fetch requests are ignored when the data has not changed, minimizing the cost associated with fetch requests over the lifetime of an application. The name used for the cache is arbitrary. Either use nil to prevent caching or supply a name in the form of a string. This method uses nil to avoid errors related ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access