Design Element
Comment on "Lazy Loading of KVO Observed Properties"
by Jens Alfke — Jun 19
"When the parent object is initialized, the value is nil. When the value is the lazily loaded, it becomes non-nil."

The value is not nil. The instance variable is nil. But that is an internal detail of the implementation. (You might have filled in the ivar in the -init method, and the class would behave the same.)

The value of the property is the result of the accessor method; as far as the outside world is concerned, its value is completely unknown until it's asked for.

So in this case, the getter should not attempt to notify observers.
Back to "Lazy Loading of KVO Observed Properties"
Design Element

Copyright © Scott Stevenson 2004-2015