Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/objective-c/27.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_Objective C_Rest_Restkit_Restkit 0.20 - Fatal编程技术网

Ios Restkit对象映射

Ios Restkit对象映射,ios,objective-c,rest,restkit,restkit-0.20,Ios,Objective C,Rest,Restkit,Restkit 0.20,我正在努力映射以下json响应: { "data": { "plans": [ { "planid":"10", "plandescription":"foo", "plantype":"2", "planvalue":"30", "status":"Active" }

我正在努力映射以下json响应:

{
 "data":
       {
        "plans":
          [
           {
             "planid":"10",
             "plandescription":"foo",
             "plantype":"2",
             "planvalue":"30",
             "status":"Active"
           }
         ]
       }
}
这就是我想做的:

RKObjectMapping *planMapping = [RKObjectMapping mappingForClass:[Plans class]];
[planMapping addAttributeMappingsFromDictionary:@{
 @"planid": @"planId",
 @"plandescription": @"planDescription",
 @"plantype": @"planType",
 @"planvalue": @"planValue",
 @"status" : @"status"
 }];

RKResponseDescriptor *planResponseDescriptor = [RKResponseDescriptor responseDescriptorWithMapping:planMapping pathPattern:nil keyPath:@"data/plans" statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];
[objectManager addResponseDescriptor:planResponseDescriptor];

但是对象没有被映射:\n怎么了?

尝试将keyPath:@“data/plan”更改为keyPath:@“data.plan”

是否修复了它?