O'Reilly logo

Learning iOS Development: A Hands-on Guide to the Fundamentals of iOS Programming by Erica Sadun, Rod Strougo, Maurice Sharp

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Part 1: Integrating NSFetchedResultsController

You need an instance variable to hold the fetched results controller. Add the following declaration below the one for fetchRequest after the @implementation statement at the top of CarTableViewController.m:

NSFetchedResultsController *fetchedResultsController;

Now you need to initialize the fetched results controller. Doing so requires setting up an appropriate fetch request. This is because NSFetchedResultsController maps the result of applying a fetch request to a managed object context into index paths.

In Listing 9-2, you used a simple NSFetchRequest for returning all CDCar entities. A fetched results controller requires at least a filter and a sort. The filter can ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required