3 ms·
Ah, thanks for correcting me. I didn't have time to go through it yet. https://github.com/facebook/KVOController#usage https://github.com/facebook/KVOControlle
by seivan 13y ago
Ah, thanks for correcting me. I didn't have time to go through it yet.
https://github.com/facebook/KVOController#usage https://github.com/facebook/KVOController#usage
By controller does the readme refer to the KVOController instance?
I assume this is a property on the class that uses it, and once the class gets dealloced, its observer also get dealloced?
FBKVOController
Hmm... I think this is a much better idea! Much cleaner than what I current got going, but then again we don't offer the same api. Thanks for correcting me!
- kimon 13y agoCorrect. Add a strong reference from observer to KVOController instance via a property or instance variable and you've achieved un-observation on observer dealloc :) This usage pattern is quite common. We'll look into calling this out more explicitly in the readme. Thanks for the feedback!