Hacker News new | ask | show | jobs
by natasham25 4497 days ago
KVO is built-in to iOS, but it has some serious issues. One BIG issue is that you have to register to observe a key in order to de-register from it later. If you never register for the key (because it is dynamic for example), and try to de-register, the app will crash. It's a pretty big issue, and this seems to handle it in a pretty elegant way.
3 comments

This was the principal motivation behind KVOController. Manually tracking registered observers is tedious and error prone. We hope you give KVOController a try, feedback from the community is welcome.
Elegant and elegant, the swizzle (alter it in runtime) the class to remove observers on dealloc (afaik I haven't seen the source yet)
I remove observers within a @try {} @catch{} block. The exceptions are caught and I can fix where necessary.