Restkit 20无法匹配所有(0)响应描述符

时间:2014-04-16 17:55:43

标签: restkit-0.20

我不知道是否未能匹配所有(0)响应描述符意味着有0个描述符?

以下是一些日志:

路径: 搜索/患者?q = qwer& start = 0& max = 40

BASE网址: https://amb.XXX.com/

RKRESPONSEDESCRIPTORS:

(
    "<RKResponseDescriptor: 0xaaca6a0 method=(GET) pathPattern=search/patients?q=qwer&start=0&max=40 keyPath=(null) statusCodes=(null) : <RKObjectMapping:0xaab4f80 objectClass=NSMutableDictionary propertyMappings=(\n    \"<RKAttributeMapping: 0x9edf630 final_page => finalPage>\",\n    \"<RKRelationshipMapping: 0xaac9750 results => patientSearchResultDetails>\"\n)>>"
)


restkit.object_mapping:RKMapperOperation.m:378 Executing mapping operation for representation: {
    "final_page" = 1;
    results =     (
                {
            age = "39 years";
            "date_of_birth" = "1975-01-15";
            gender = Male;
            mrns =             {
                effective =                 (
                    10000423
                );
                ineffective =                 (
                );
            };
            "name_full_formatted" = "DOE, PETER";
            "person_id" = 1390007;
            "phone_numbers" =             {
                home = "(816) 555-5555";
            };
            "preferred_name" = PETE;
            "primary_care_provider" =             {
                name = "Test, Physician4";
            };
        }
    );
}

和targetObject :( null) 2014-04-16 12:45:03.263 IONShell [31463:4f03] D restkit.object_mapping:RKMapperOperation.m:404完成执行对象映射。结果:( null) 2014-04-16 12:45:03.264 IONShell [31463:4e1b] E restkit.network:RKObjectRequestOperation.m:208 GET'https://amb.XXX.com/search/patients?q=qwer&start=0&max=40'(200 OK / 0个对象)[request = 1.5086s mapping = 0.0000s总= 1.5143s]: error = Error Domain = org.restkit.RestKit.ErrorDomain Code = 1001“没有响应描述符与加载的响应匹配。” UserInfo = 0xa9eead0 {NSErrorFailingURLStringKey = https://amb.XXX.com/search/patients?q=qwer&start=0&max=40,NSLocalizedFailureReason =从URL“https://amb.XXX.com/search/patients?q=qwer&start=0&max=40”加载了200响应,该响应未能匹配所有(0)响应描述符:,NSLocalizedDescription =没有响应描述符与响应匹配loaded。,keyPath = null,NSErrorFailingURLKey = https://amb.XXX.com/search/patients?q=qwer&start=0&max=40,NSUnderlyingError = 0xa9e3f40“在搜索的关键路径中找不到可映射的对象表示。”}

(0)是否意味着我的RKObjectManager没有响应描述符?还是我错过了别的什么?这让我疯了。 感谢

1 个答案:

答案 0 :(得分:1)

搞清楚。我需要将字符串的查询部分发送为params。

 NSDictionary *params = [NSDictionary dictionaryWithObjectsAndKeys:queryString, @"q", start, @"start", maxCount, @"max", nil];


    [self loadObjectsAtResourcePath:@"search/patients" params:params objectMapping:mapping]