如果你看看RKClient實施get:delegate:
它只是這是否
- (RKRequest *)get:(NSString *)resourcePath delegate:(id)delegate {
return [self load:resourcePath method:RKRequestMethodGET params:nil delegate:delegate];
}
和load:method:params:delegate:
實現是
- (RKRequest *)load:(NSString *)resourcePath method:(RKRequestMethod)method params:(NSObject<RKRequestSerializable> *)params delegate:(id)delegate {
NSURL* resourcePathURL = nil;
if (method == RKRequestMethodGET) {
resourcePathURL = [self URLForResourcePath:resourcePath queryParams:(NSDictionary*)params];
} else {
resourcePathURL = [self URLForResourcePath:resourcePath];
}
RKRequest *request = [[RKRequest alloc] initWithURL:resourcePathURL delegate:delegate];
[self setupRequest:request];
[request autorelease];
request.method = method;
if (method != RKRequestMethodGET) {
request.params = params;
}
[request send];
return request;
}
它不使用任何RKClient狀態/共享數據,所以你不會看到問題。方法get:delegate:本身就是異步的,所以這個東西無論如何都會在後臺發生。