How do you remove KVO from a weak property?

I find any kind of code required specially for this case really unnecessary as removal can be automated.

With the introduction of ARC, Apple should have provide automatic removal of observers that would fix cases like this, but unfortunately they didn’t. But I’ve made my own category that adds this lacking feature: https://github.com/krzysztofzablocki/SFObservers
I’ve explained how I did manage that on my blog: http://www.merowing.info/2012/03/automatic-removal-of-nsnotificationcenter-or-kvo-observers/

If you look at my solution you will notice, that it makes sure that original code is called, even if one of the methods call other ones, so that even if apple changes its internal behavior the category will still work fine 🙂

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)