mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-22 20:18:53 +08:00
Reorder logging statement so that logging occurs before sending of request to avoid sending message to a zombie instance. fixes #600
This commit is contained in:
@@ -529,8 +529,6 @@ RKRequestMethod RKRequestMethodTypeFromName(NSString *methodName) {
|
||||
|
||||
_isLoading = YES;
|
||||
|
||||
// TODO: WTF? Why was this afterDelay in here???
|
||||
// [self performSelector:@selector(didFinishLoad:) withObject:[self loadResponseFromCache] afterDelay:0];
|
||||
[self didFinishLoad:[self loadResponseFromCache]];
|
||||
|
||||
} else {
|
||||
@@ -539,7 +537,7 @@ RKRequestMethod RKRequestMethodTypeFromName(NSString *methodName) {
|
||||
NSDictionary *userInfo = [NSDictionary dictionaryWithObjectsAndKeys:
|
||||
errorMessage, NSLocalizedDescriptionKey,
|
||||
nil];
|
||||
NSError* error = [NSError errorWithDomain:RKErrorDomain code:RKRequestBaseURLOfflineError userInfo:userInfo];
|
||||
NSError* error = [NSError errorWithDomain:RKErrorDomain code:RKRequestBaseURLOfflineError userInfo:userInfo];
|
||||
_isLoading = YES;
|
||||
[self performSelector:@selector(didFailLoadWithError:) withObject:error afterDelay:0];
|
||||
}
|
||||
|
||||
@@ -289,8 +289,8 @@ static const NSTimeInterval kFlushDelay = 0.3;
|
||||
}
|
||||
|
||||
[self addLoadingRequest:request];
|
||||
[request sendAsynchronously];
|
||||
RKLogDebug(@"Sent request %@ from queue %@. Loading count = %ld of %ld", request, self, (long) self.loadingCount, (long) _concurrentRequestsLimit);
|
||||
[request sendAsynchronously];
|
||||
|
||||
if ([_delegate respondsToSelector:@selector(requestQueue:didSendRequest:)]) {
|
||||
[_delegate requestQueue:self didSendRequest:request];
|
||||
|
||||
Reference in New Issue
Block a user