Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

“…by specifying a context every time and using one that’s not only unique to your object but also to the file containing your subclass you can ensure that the message sent to you is actually for you and you avoid potentially stepping on the toes of your super class.”

http://zearfoss.wordpress.com/2011/11/29/a-cool-kvo-trick/



I get it now.

You also could use [object class] instead of an arbitrary static pointer.

I never had issue with a class and a subclass using the same observer keypath. Whenever I use it I always call super to make sure everything underneath is called. But that's a good thing to know for sure, thanks.




Consider applying for YC's Winter 2026 batch! Applications are open till Nov 10

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: