[super observeValueForKeyPath:...] is dangerous. For example, the NSObject implementation throws an exception, so following Apple’s documentation will result in runtime errors."I'd still recommend calling super, but only for any notifications that you _weren't_ the one to sign up for (i.e. don't _unconditionally_ pass everything along to super). You could skip it if you inherit directly from NSObject, but calling super would also serve as a bit of a sanity check, since if you end up passing along a notification that actually _was_ yours, you'll get an exception thrown and know that something is wrong.
And of course the entire discussion is moot if you just use KVO+Blocks instead. :-)
Oh yeah, and here are the links to the versions of the code I was referring to in the presentation:
My version of KVO+Blocks: https://gist.github.com/1220613
Andy Matuschak's original version: https://gist.github.com/153676
Jonathan Wight's KVONotificationManager: https://github.com/schwa/KVO-Notification-Manager
--
Brian Webster
bewe...@gmail.com
> --
> You received this message because you are subscribed to the Google Groups "XCodePhoenix" group.
> To post to this group, send email to xcodep...@googlegroups.com.
> To unsubscribe from this group, send email to xcodephoenix...@googlegroups.com.
> For more options, visit this group at http://groups.google.com/group/xcodephoenix?hl=en.
Here we go with bad dot notation. It looks like that should be good since you're only incrementing the right ivar, but it's not. You're actually incrementing the -right method call which can't be done. Another example of dot notation leading someone awry. ;)
Brad Miller
br...@cynicalpeak.com
http://cynicalpeak.com/
Brent
Sent from my iPhone
--
Jiva DeVoe
Random Ideas, LLC
http://www.random-ideas.net