views:

34

answers:

2

From the docs:

When Core Data turns an object into a fault, key-value observing (KVO) change notifications (see Key-Value Observing Programming Guide) are sent for the object’s properties. If you are observing properties of an object that is turned into a fault and the fault is subsequently realized, you receive change notifications for properties whose values have not in fact changed.

So if an object turns into a fault, Core Data does send KVO notifications for changed properties? So I must always check for isFault == NO before beeing happy about the notification?

+1  A: 

That is one solution. A better solution would be to stop observing the object when it gets turned into a fault. In practice, except for in low memory situations, you know when an object is going to be turned into a fault and can plan for it.

Marcus S. Zarra
A: 

(This isn't really an answer, more of a follow-up question. If this is not the way to do this, please let me know and I will correct it.)

Okay, but what would be the recommended strategy in the case where the object that is being observed is an attribute of an object at the end of a relationship? In this case, how would the observer (self) know when the observed object is faulted?

Also would you mind giving more detail on how would one "know when an object is going to be turned into a fault"?

Martin Stanley