• 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: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

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


  • Follow-Ups:
    • Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!
      • From: Quincey Morris <email@hidden>
References: 
 >removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?! (From: Sean McBride <email@hidden>)
 >Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?! (From: Quincey Morris <email@hidden>)
 >Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?! (From: Sean McBride <email@hidden>)
 >Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?! (From: Quincey Morris <email@hidden>)

  • Prev by Date: Re: NSRunningApplication executableURL issue in Swift
  • Next by Date: Cocoa GUI app getting slower on MacPro or MacMini when disconnecting all screens
  • Previous by thread: Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!
  • Next by thread: Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!
  • Index(es):
    • Date
    • Thread