0
votes

I've the following method:

- (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];
    };
}];
}

To Send get requests. So how can I map the JSON-Response using a RKObjectManager?

Maik

1

1 Answers

1
votes

You're looking a little deep.

Look into using one of the "loadObjectsAtResourcePath" calls. Or perhaps one of the "getObject" calls, that are both part of RKObjectManager.

Also, an excellent resource for how to use these calls are right in RestKit's unit-tests. Extremely helpful.