RestKit/RestKit — pull request #717 by dusek (2012-05-06 15:37:32+00:00)
Title: RKObjectManager now compatible with client's reachability observer changes

When changing object manager's client.reachabilityObserver,
my client always asserted in [RKReachabilityObserver
validateIntrospection], because self.isReachabilityDetermined == NO.
I found out that this is probably due to this:

* object manager's client.reachabilityObserver is assigned to new
value
* object manager still listens to client's old reachability observer
* old reachability observer sends notification that reachability
changed
* new reachability observer hasn't still determined its reachability
* object manager processes the notification from old reachability
observer, but when doing so asks
self.client.reachabilityObserver (a.k.a. the new reachability
observer) for reachability details
* new reachability observer asserts that it is being asked for
reachability details when it hasn't determined its reachability

My solution is to simply make object manager always listen to the
current client's current reachability observer by detecting
its changes through KVO.

I am very new to RestKit, so please check I did not miss something :-)
At the very least I don't know whether we shouldn't send a
RKObjectManagerDidBecomeUndeterminedNotification (which does not
yet exist). I also did not write any tests, since the assert did happen asynchronously
from the code that changed the reachability observer (it happened when the reachability
was determined), and I don't know how I would test for something like that.