DevPrep

All topics › Databases & storage

NSFetchedResultsController

Middle PRO

Essence

NSFetchedResultsController (FRC) is a controller that executes an NSFetchRequest in a given context, keeps the result in memory and observes changes in that context: when matching objects are inserted, deleted, updated or moved, it notifies its delegate. It's the classic way to connect Core Data to a UITableView/UICollectionView without manual refetching.

The rest of this answer, with code and interview follow-ups, is in the DevPrep app.

Read the full answer in DevPrep

Practice this before your interview

DevPrep turns these answers into one-minute challenges: what does this code print, find the bug, mock interviews. One challenge a day.

Get DevPrep on the App Store