Faults

Relationships are fetched in a lazy manner. When you fetch a managed object with relationships, the objects at the other end of those relationship are not fetched. Instead, Core Data uses faults. There are to-many faults (which stand in for sets) and to-one faults (which stand in for managed objects). So, for example, when the instances of BNRItem are fetched into your application, the instances of BNRAssetType are not. Instead, fault objects are created that stand in for the BNRAssetType objects until they are really needed.

Figure 16.15  Object faults

Object faults

An object fault knows what entity it is from and what its primary key is. So, for example, ...

Get iOS Programming: The Big Nerd Ranch Guide now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.