Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!

2015-03-12 Thread Sean McBride
On Wed, 11 Mar 2015 23:28:08 +, Quincey Morris said: — I don’t think it’s a very good idea to do this (slightly abbreviated from your source): - (void)bind:(NSString*)inBindingName toObject:(id)inObservableObject withKeyPath:(NSString*)inKeyPath options:(NSDictionary*)inOptions {

Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!

2015-03-12 Thread Jonathan Mitchell
On 11 Mar 2015, at 23:28, Quincey Morris quinceymor...@rivergatesoftware.com wrote: I don’t have an explanation of exactly why that might fail, but it certainly seems a lot like the conditions for bug I talked about earlier. You have the same object observing the same property of the

Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!

2015-03-12 Thread Quincey Morris
On Mar 12, 2015, at 03:01 , Jonathan Mitchell jonat...@mugginsoft.com wrote: But surely this is the whole point of the context - to be able to differentiate between multiple observations to the same object and path. I think the point is to differentiate between multiple observations to the

Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!

2015-03-11 Thread Sean McBride
On Wed, 11 Mar 2015 21:06:46 +, Jonathan Mitchell said: I recently refactored my app to use removeObserver:forKeyPath:context: rather than removeObserver:forKeyPath and it went without a hitch. We did the same refactor a couple of years ago, and it went great also. We missed just one or

Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!

2015-03-11 Thread Quincey Morris
On Mar 11, 2015, at 11:31 , Sean McBride s...@rogue-research.com wrote: If you're curious I can put it online. Sure, I’d be interested to see it. ___ Cocoa-dev mailing list (Cocoa-dev@lists.apple.com) Please do not post admin requests or moderator

Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!

2015-03-11 Thread Jonathan Mitchell
On 11 Mar 2015, at 18:31, Sean McBride s...@rogue-research.com wrote: On Tue, 10 Mar 2015 18:25:23 +, Quincey Morris said: If something else is using a conflicting ‘removeObserver:forKeyPath:’, it might sorta work if all observers use it (because the total number of removals is equal

Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!

2015-03-11 Thread Sean McBride
On Tue, 10 Mar 2015 18:25:23 +, Quincey Morris said: If something else is using a conflicting ‘removeObserver:forKeyPath:’, it might sorta work if all observers use it (because the total number of removals is equal to the number of observations, even if they remove each others’ observations),

Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!

2015-03-11 Thread Sean McBride
On Wed, 11 Mar 2015 20:24:34 +, 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

Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!

2015-03-11 Thread Quincey Morris
On Mar 11, 2015, at 15:03 , Sean McBride s...@rogue-research.com wrote: It's here: I just spent a few minutes with it. A couple of things: — I don’t think it’s a very good idea to do this (slightly abbreviated from your source): - (void)bind:(NSString*)inBindingName

removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!

2015-03-10 Thread Sean McBride
Hi all, Can anyone think of a sitation where using removeObserver:forKeyPath: works correctly, then modernizing the code to use removeObserver:forKeyPath:context: breaks things? Long story: I have a custom NSView subclass that exposes a custom binding. In bind: it does

Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!

2015-03-10 Thread Quincey Morris
On Mar 10, 2015, at 10:50 , Sean McBride s...@rogue-research.com wrote: Can anyone think of a sitation where using removeObserver:forKeyPath: works correctly, then modernizing the code to use removeObserver:forKeyPath:context: breaks things? If something else is using a conflicting

Re: removeObserver:forKeyPath:context: fails; but removeObserver:forKeyPath: works?!

2015-03-10 Thread Keary Suska
On Mar 10, 2015, at 11:50 AM, Sean McBride s...@rogue-research.com wrote: Hi all, Can anyone think of a sitation where using removeObserver:forKeyPath: works correctly, then modernizing the code to use removeObserver:forKeyPath:context: breaks things? Long story: I have a custom NSView