Question

I've read the document several times, but I still don't get what the "Fault" means?

Is it an Object or just a value?

And as a verb what would "Fault" do?

Thanks a lot!

Was it helpful?

Solution

An object relationship is a fault when the data that the relationship points to has not been loaded into memory. So instead of storing the "real" value of the relationship, it stores a fault instead. When you try to access that relationship, it detects the fault, goes to the store, gets the object(s) that the relationship points to, swaps it out for the fault and gives you what you were actually asking for in the first place.

This allows the system to load objects into memory without having to load all of the relationships which take up memory if you aren't going to use them.

For instance, if you have an object Department and it has a relationship with multiple employees (lets say hundreds of employees) when you load the Department, it loads all of the properties for your Department but only stores a reference (fault) to all of the employees. Then when you actually try to look at an employee it will load the data and give it to you.

OTHER TIPS

Fault means that Core Data must take a trip all the way to a backing store to retrieve the requested info because it doesnt exist in memory at the moment. I assume that property means the object must perform a fault.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top