RestKit crashes when resuming application from background

I am using the RestKit environment for my application to communicate with the JSON server. Everything is going fine until I hit the home button and try to resume my application. I get exception_bad_access in this framework method:

- (BOOL)shouldDispatchRequest {
if (nil == self.reachabilityObserver || NO == [self.reachabilityObserver isReachabilityDetermined]) {
    return YES;
}

return [self.reachabilityObserver isNetworkReachable];

}

In this line: if (nil == self.reachabilityObserver || NO == [self.reachabilityObserver isReachabilityDetermined]) {

If I try to reopen the application a second time, when it loads without any problems, but loses the screen I was on, and the subsequent information.

Any idea on resolving this issue?

Thanks Clinton

+3
source share
1 answer

Try replacing it with the following:

- (BOOL)shouldDispatchRequest {
    if (nil != self.reachabilityObserver && YES == [self.reachabilityObserver isReachabilityDetermined]) {
        return [self.reachabilityObserver isNetworkReachable];
    }
}

return YES;
0
source

All Articles