• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Strange behavior of observeValueForKeyPath:ofObject:change:context:
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


References: 
 >Strange behavior of observeValueForKeyPath:ofObject:change:context: (From: WT <email@hidden>)

  • Prev by Date: NSAppleScript returns wrong result on multiple Safari windows, applescript editor work
  • Next by Date: Re: Localize Attributed Strings?
  • Previous by thread: Strange behavior of observeValueForKeyPath:ofObject:change:context:
  • Next by thread: Problem with AFP server Notification seek advice.
  • Index(es):
    • Date
    • Thread