O'Reilly logo

Core Data in Swift by Marcus S. Zarra

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

How to Use the NSFetchedResultsController

When Core Data was added to iOS, it was clear to the Core Data team that Core Data and the UITableView would be used together extensively. They also realized that getting these two pieces to work together smoothly would require a fair amount of code that could be abstracted away; that abstraction is the NSFetchedResultsController. The NSFetchedResultsController is the glue that binds a UITableView to Core Data so that we need to write very little code.

The purpose of the NSFetchedResultsController is twofold. The NSFetchedResultsController is designed to retrieve data from Core Data and store that data for access. It does this with an internal NSFetchRequest that it uses for the retrieval. It then stores ...

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