Theocacao
Leopard
Design Element
Comment on "Lazy Loading of KVO Observed Properties"
by Paul Thomas — Jun 18
I'm a little confused about how visible everything is to the world outside your object. Is _myImage actually visible to users of your object other than via the getter and setter?

You say that setting the ivar directly "breaks the Key-Value Observing contract", but you aren't changing the value of the property - just the 'cache' that you've called _myImage. Repeated calls to myImage or valueForKey:@"myImage" will return the same image, so what does it matter that a private ivar has changed?
Back to "Lazy Loading of KVO Observed Properties"
Design Element

Copyright © Scott Stevenson 2004-2015