Theocacao
Leopard
Design Element
Comment on "Lazy Loading of KVO Observed Properties"
by Scott Stevenson — Jun 19
@mmalc: Semantically, the value has not changed. It has simply been retrieved

I think for the most part this is okay, but what about when the value is set to nil at some point after it is loaded even (whether intentionally or not)? The observers may end up with incorrect data in some cases. Those cases may not be common, but they would be extremely difficult to debug.

I've seen so, so many bugs that were ultimately traced back to not honoring the KVO contract because the developer thought it wasn't important in that case. Obviously, your opinion holds weight, but personally, I think it's better to be truthful about when the value changes, even if you think no one is listening.
Back to "Lazy Loading of KVO Observed Properties"
Design Element

Copyright © Scott Stevenson 2004-2015