O'Reilly logo

Mastering iOS 10 Programming 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

Reacting to database changes

In its current state, our app doesn't update its interface when a new managed object is persisted. One proposed solution for this was to manually reload the table right after we insert a new family member. Although this might work well for some time, it's not the best solution to this problem. If our application grows, we might add some functionality that enables us to import new family members from the network. Manually refreshing the table view would be problematic because our networking logic should not be aware of the table view. Luckily, there is a better suited solution to react to changes in your data.

First, we'll implement a fetched results controller to update our list of family members. Next, we'll listen ...

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