Re: removeObserver:forKeyPath: when already removed

2009-11-11 Thread Jim Correia
On Nov 11, 2009, at 7:36 PM, Jerry Krinock wrote: >> Trying to remove an observer for a key path which has already been removed >> (or never registered) falls into the programming error class... > > Almost always true. But what if, and yes I know this is pretty flakey but > just assume it coul

Re: removeObserver:forKeyPath: when already removed

2009-11-11 Thread Shawn Erickson
On Wed, Nov 11, 2009 at 2:35 PM, James Walker wrote: > I had a situation where removeObserver:forKeyPath: was called twice for the > same receiver (an NSUserDefaultsController), the same observer, and the same > key path.  It threw an NSRangeException.  But the KVO docs don't say > anything about

Re: removeObserver:forKeyPath: when already removed

2009-11-11 Thread Jerry Krinock
On 2009 Nov 11, at 15:36, Jim Correia wrote: Cocoa reserves the use of exceptions for programming errors an unexpected runtime errors. :)) Trying to remove an observer for a key path which has already been removed (or never registered) falls into the programming error class... Almost

Re: removeObserver:forKeyPath: when already removed

2009-11-11 Thread Jim Correia
On Nov 11, 2009, at 5:35 PM, James Walker wrote: > I had a situation where removeObserver:forKeyPath: was called twice for the > same receiver (an NSUserDefaultsController), the same observer, and the same > key path. It threw an NSRangeException. But the KVO docs don't say anything > about r

removeObserver:forKeyPath: when already removed

2009-11-11 Thread James Walker
I had a situation where removeObserver:forKeyPath: was called twice for the same receiver (an NSUserDefaultsController), the same observer, and the same key path. It threw an NSRangeException. But the KVO docs don't say anything about removeObserver:forKeyPath: throwing an exception. Should