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: Quincey Morris <email@hidden>
- Date: Tue, 6 Jan 2009 09:47:21 -0800
On Jan 6, 2009, at 06:55, WT wrote:
The reason for the comparison between the old and new values should
be obvious, namely, I don't want to redraw the screen unless the
value of the original key has in fact changed.
Now, here's the problem: when I run my app, both the old and new
values are logged as simply 0 (zero). That's clearly incorrect
because (a) not all of my properties are numbers (some are colors,
for example) and (b) I know I've made a change and yet the old and
new values come out equal.
In this scenario, typically the dependent property doesn't have a
useful value -- all you care about is the notification.
If you *are* trying to maintain a genuine value for the
"displayNeeded" property, then we need to see the code that maintains
it.
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. :)
_______________________________________________
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