Re: NSUserDefault controller bindings - observeValueForKeyPath called twice?
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