• 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: NSUserDefault controller bindings - observeValueForKeyPath called twice?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: NSUserDefault controller bindings - observeValueForKeyPath called twice?


  • Subject: Re: NSUserDefault controller bindings - observeValueForKeyPath called twice?
  • From: Quincey Morris <email@hidden>
  • Date: Fri, 18 Aug 2017 10:40:32 -0700

On Aug 18, 2017, at 02:23 , Nick <email@hidden> wrote:
>
> The problem is that observeValueForKeyPath is being called twice every time
> I move the slider or enter a new value in the edit.

This may be an artifact of updating the “model” (i.e. UserDefaults”) via a
binding, and you may not be able to control it. I would suggest not wasting any
effort on preventing the double notification, but rather filter unnecessary
notifications in your observer method. (You can set the options for passing the
new and old values into the observer method, if you don’t wan’t to track the
actual values yourself.)

_______________________________________________

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: 
 >NSUserDefault controller bindings - observeValueForKeyPath called twice? (From: Nick <email@hidden>)

  • Prev by Date: Re: Question about Audio for iOS (SessionCategory?)
  • Next by Date: Re: Question about Audio for iOS (SessionCategory?)
  • Previous by thread: Re: NSUserDefault controller bindings - observeValueForKeyPath called twice?
  • Next by thread: Question about Audio for iOS (SessionCategory?)
  • Index(es):
    • Date
    • Thread