Re: removeObserver:forKeyPath: when already removed
Re: removeObserver:forKeyPath: when already removed
- Subject: Re: removeObserver:forKeyPath: when already removed
- From: Jerry Krinock <email@hidden>
- Date: Wed, 11 Nov 2009 16:36:02 -0800
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 always true. But what if, and yes I know this is pretty flakey
but just assume it could happen, that I needed to do some very
expensive operation to determine whether or not an observation had
been removed. Then, it would be efficient and smart to send the
removeObserver:: message unconditionally.
But how is the programmer to know this is an error if it's not
documented as a "don't do"? If indeed this is not documented, then in
my opinion it's a documentation error.
_______________________________________________
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