Core Data Confusion

Scott Stevenson sstevenson at mac.com
Mon Feb 5 09:55:27 PST 2007


On Feb 5, 2007, at 9:04 AM, Marcus S. Zarra wrote:

> The KVO methods do not fire faults in Core Data. [...]
> The primitive methods will cause a fault to fire on a lazy  
> relationship.

Even if that's true now (and I don't think it is), it could change in  
the future. It's an implementation detail which is encapsulated and  
shouldn't be relied on.


> The -willChangeValueForKey: and -didChangeValueForKey: should be  
> wrapped around any calls to primitive setters -- not getters

True, but these are easily confused with -will__Access__ValueForKey:  
and -did__Access__ValueForKey: which do (potentially) fire faults.

There are two sets of will/did notifications:

Getters:
- willAccessValueForKey;
- didAccessValueForKey;

Setters:
- willChangeValueForKey:
- didChangeValueForKey:

I heard your Late Night Cocoa interview* (which was quite good), so  
you clearly know what you're talking about. I suspect there was a  
typo somewhere in this thread that caused all of this confusion.

Ironically, the word confusion is right in the thread name.

     - Scott

(* http://latenightcocoa.com/?q=node/16)



More information about the MacOSX-dev mailing list