HNHacker News
TopNewBestAskShowJobs

kimon

25 karma · joined July 12, 2011

Facebook Paper Lead Engineer • Push Pop Press Co-Founder • Apple iOS Engineer
submissionscomments
kimon··on Facebook open-sources KVOController – simpler key-value observing for iOS
KVOController 1.0.0 supports observing arrays and other ordered relationships, just not values within. I filed https://github.com/facebook/KVOController/issues/5 to track. Features requests are welcome.

Performing the initial callback manually, avoiding the KVO initiated one, was shown to be a performance improvement under certain KVO configurations.

We've updated the readme to include an example tracking the controller object. An instance variable should all that is necessary: https://github.com/facebook/KVOController.

kimon··on Facebook open-sources KVOController – simpler key-value observing for iOS
Correct. 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!

kimon··on Facebook open-sources KVOController – simpler key-value observing for iOS
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.
kimon··on Facebook open-sources KVOController – simpler key-value observing for iOS
This is a useful collection of links. One point of note, Facebook's solution doesn't rely on swizzling. Much like THObserversAndBinders, KVOController ties observation to the controller scope.

We use a shared controller instance, that acts as a receptionist for all KVO notifications, as well as a weak reference to the observer, in order to safely allow observer removal on dealloc.

kimon··on Apple's HTTP POST caching is a bug
each product team at Apple is different. some pay close attention to duplicate counts when prioritizing radars, others don't.

if instead you wanted to read between the lines: please file a dupe (we have no idea when that will be fixed.) no need to file a dupe (oh cute, you're still running that ancient public build?)