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

Reading data with a simple fetch request

The simplest way to fetch data from your database is to use a fetch request. The managed object context forward fetches requests to the persistent store coordinator. The persistent store coordinator will then forward the request to the persistent store, which will then convert the request to an SQLite query. Once the results are fetched, they are passed back up this chain and converted to NSManagedObjects. By default, these objects are called faults. When an object is a fault, it means that the actual properties and values for the object are not fetched yet, but they will be fetched once you access them. This is an example of a good implementation of lazy variables because fetching the values is a ...

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