In most cases this is not the case. This is a mechanism called Faulting in Core Data. The framework takes care of the implementation of failures behind the scenes when you request an object that is not yet implemented (i.e., loaded into memory).
Error handling is transparent - you do not need to select to implement the error. If at some stage a permanent property of the failure object is reached, then Core Data automatically retrieves the data for the object and initializes the object (see the NSManagedObject Class Reference for a list of methods that do not lead to malfunctions). This process is commonly referred to as failure. If you send a department object a message to get, say, its name, then an error occurs, and in this situation, Core Data fetches to get all the attributes of the object.
So, in your example, if you load A, Core Data will corrupt instances of B (i.e., not load them into memory), and when you really try to access B, then it will implement an error (i.e. load in memory).
Conversely, there are times when you load objects into memory, and you would like to "unload" them. This is called turning objects into malfunctions.
You can turn the implemented object into an error using the refreshObject: mergeChanges: method. If you pass NO as an argument to mergeChanges, you must be sure that no changes are made to these objects. If they exist, and you save the context, you will encounter referential integrity issues in persistent storage.
mprivat
source share