Calling -addObserver:forKeyPath:… more than once
Calling -addObserver:forKeyPath:… more than once
- Subject: Calling -addObserver:forKeyPath:… more than once
- From: Rick Mann <email@hidden>
- Date: Fri, 26 Aug 2011 02:34:33 -0700
Is -addObserver:forKeyPath:… idempotent? I called it multiple times with the same parameters, but called -removeObserver:forKeyPath: only once, and the object continued to receive KVO notifications.
After adding code to ensure -addObserver:forKeyPath:… was only called once, -removeObserver:forKeyPath: seemed to work as expected.
I couldn't find any clear indication in the docs or searching online, although I did find some things that indicate these APIs rather do suck.
--
Rick
_______________________________________________
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