Warning: file_get_contents(/data/phpspider/zhask/data//catemap/9/ios/97.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
iOS:RestKit对象管理器_Ios_Restkit - Fatal编程技术网

iOS:RestKit对象管理器

iOS:RestKit对象管理器,ios,restkit,Ios,Restkit,我有以下方法: - (void)httpGET:(NSString*)resourcePath withParameter:(NSDictionary*)params withRequestID:(RequestID)requestID { if ([RKClient sharedClient] == nil) [RHCHTTPController initRKSharedClient]; RKURL *url = [RKURL URLWithBaseURLString:BaseURL

我有以下方法:

- (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];
    };
}];
}
发送get请求。那么,如何使用RKObjectManager映射JSON响应呢


Maik

你看起来有点深沉

研究如何使用“loadObjectsAtResourcePath”调用之一。或者可能是一个“getObject”调用,这两个调用都是RKObjectManager的一部分

另外,RestKit的单元测试中提供了一个关于如何使用这些调用的优秀资源。非常有用