Re: Strange behavior of observeValueForKeyPath:ofObject:change:context:
Re: Strange behavior of observeValueForKeyPath:ofObject:change:context:
- Subject: Re: Strange behavior of observeValueForKeyPath:ofObject:change:context:
- From: WT <email@hidden>
- Date: Tue, 6 Jan 2009 19:23:51 +0100
Hi Quincey,
thank you for your reply.
In this scenario, typically the dependent property doesn't have a
useful value -- all you care about is the notification.
Yes, that's my intention.
If you *are* trying to maintain a genuine value for the
"displayNeeded" property, then we need to see the code that
maintains it.
I'm not.
I'll go out on a limb and suggest that trying to maintain a genuine
value for "displayNeeded" is both horribly difficult and a terrible
mistake. :)
I think I understand now what's going on. I was under the (clearly
mistaken) impression that the change dictionary refers to the original
property that changed, and not to the dependent property. But, come to
think of it, that's so obvious that it should refer to the dependent
property, in which case it makes perfect sense that its value is zero
(it's a boolean that never got set to anything, and so gets auto
initialized to NO) and didn't change, because no setter has been
called to change it.
It's funny... I stared at that code for 2 days with not a clue about
what the problem is and it's now so obvious that the KVO mechanism
wouldn't know nor care that it's dealing with a dependent property
and, hence, wouldn't do anything special.
Thank you again Quincey.
Wagner
_______________________________________________
Cocoa-dev mailing list (email@hidden)
Please do not post admin requests or moderator comments to the list.
Contact the moderators at cocoa-dev-admins(at)lists.apple.com
Help/Unsubscribe/Update your Subscription:
This email sent to email@hidden