Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!
Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!
- Subject: Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!
- From: Sean McBride <email@hidden>
- Date: Wed, 11 Mar 2015 18:03:33 -0400
- Organization: Rogue Research Inc.
On Wed, 11 Mar 2015 20:24:34 +0000, Quincey Morris said:
>Sure, I’d be interested to see it.
Cool, thanks. It's here:
<https://www.rogue-research.com/RemoveObserverBug.zip>
To repro:
- search for all the NSLogs in the project (4 of them) and put breakpoints there
- build & launch
- you may need to do File > New to get the window to appear
- the window has 3 custom views. bind:::: is called from windowDidLoad
- press the top push button (it mutates an NSManageObject)
- watch the logs, each of the 3 views will observe the change
- press the bottom push button (it unbinds and removes 2of3 views)
- watch the logs
- press the top push button again
Expected:
- the remaining view should have observed the change
Actual:
- the remaining view does not even get into observeValueForKeyPath::::
Notes:
- if you toggle the #if in the unbind: implementation you can "fix" the bug
Cheers,
--
____________________________________________________________
Sean McBride, B. Eng email@hidden
Rogue Research www.rogue-research.com
Mac Software Developer Montréal, Québec, Canada
_______________________________________________
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