What Is a Core Data Fault

What Is a Core Data Fault

This tutorial zooms in on an important topic for anyone working with Core Data, faulting. Faulting is a concept that often confuses developer new to Core Data. Before I explain what faulting is, I want to show it to you.

For this tutorial, I use the application we build in Mastering Core Data With Swift 3. Clone or download the repository from GitHub and open the project in Xcode 8 or higher.

[…]

Notice that the value of the tags property is missing. Instead, Xcode displays relationship fault. This means that the tags of the note haven't been fetched yet. We don't even know the number of tags that are linked to the note.

[…]

As of iOS 9, Core Data gives developers the option to fail silently by deleting any faults that are inaccessible. Even though this avoids the exception from being thrown, your application could en up in a state it doesn't know how to handle.

[…]