我有以下方法:
- (void)httpGET:(NSString*)resourcePath withParameter:(NSDictionary*)params withRequestID:(RequestID)requestID {
if ([RKClient sharedClient] == nil)
[RHCHTTPController initRKSharedClient];
RKURL *url = [RKURL URLWithBaseURLString:BaseURL resourcePath:resourcePath queryParameters:params];
[[RKClient sharedClient] get:[url absoluteString] usingBlock:^(RKRequest *request) {
NSLog(@"Request: %@", [url absoluteString]);
request.onDidLoadResponse = ^(RKResponse *response) {
[self.delegate responseArrivedWithRKResponse:response withRequestID:requestID];
};
request.onDidFailLoadWithError = ^(NSError *error) {
[self.delegate requestDidFailWithRequestID:requestID andError:error];
};
}];
}
发送获取请求。那么如何使用 RKObjectManager 映射 JSON-Response 呢?
迈克