Theocacao
Leopard
Design Element
Comment on "Lazy Loading of KVO Observed Properties"
by Ross Boucher — Jan 19
Scott,

Why not stop automatic support of KVO? Override

+ (BOOL)automaticallyNotifiesObserversForKey:(NSString *)aKey

have it return no for this specific key, and then manually call

willChangeValueForKey:

and

didChangeValueForKey:

only when appropriate? It will end up being more lines of code, but it does seem like the more "correct" solution to the problem. Just a thought. Perhaps it isn't worth the extra code.
Back to "Lazy Loading of KVO Observed Properties"
Design Element

Copyright © Scott Stevenson 2004-2015