O'Reilly logo

Mastering iOS 11 Programming - Second Edition by Donny Wals

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

Implementing a NSFetchedResultsController

The NSFetchedResultsController class notifies a delegate whenever its fetched data is changed. This means that you won't have to worry about manually reloading the view and you can simply process whatever updates the fetched results controller passes on.

Being a delegate for the fetched results controller involves the following four important methods:

  • controllerWillChangeContent(_:)
  • controllerDidChangeContent(_:)
  • controller(_:didChange:at:for:newIndexPath:)
  • controller(_:didChange:atSectionIndex:for:)

The first method, controllerWillChangeContent(_:), is called right before the controller passes updates to the delegate. If you're using a table view with a fetched results controller, this is the perfect ...

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