{
"JobID" : "aaaabbbb-dddd-eeee-ffff-aaaabbbbcccc",
"UserID": "11112222-dddd-eeee-ffff-111122223333",
"FolderVersions" : [
{
"FolderID" : "11112222-dddd-eeee-ffff-111122223333",
"Version" : "1.0"
},
{
"FolderID" : "11113333-dddd-eeee-ffff-111122223333",
"Version" : "1.2"
},
{
"FolderID" : "33332222-dddd-eeee-ffff-111122223333",
"Version" : "1.1"
}
]
}
我有带有 jobid、userid 和 nsmutable_array “folderversion”的作业类
FolderVersions:使用具有 folder_id 和 version 的 FolderVersion 类进行映射
我希望将 FolderVersions 映射到作业类中的 folderversion 数组
RKObjectMapping *jobMapping = [RKObjectMapping mappingForClass:[Job class]];
[jobMapping addAttributeMappingsFromDictionary:@{
@"JobID" : @"jobId",@"USerID":@"userID"
}];
RKObjectMapping *folderMapping = [RKObjectMapping mappingForClass:[FolderVersion class]];
[folderMapping addAttributeMappingsFromDictionary:@{@"FolderID":@"folderID",
@"Version":@"version",
}];
RKResponseDescriptor *responseDescripor1 = [RKResponseDescriptor jobMapping
method:RKRequestMethodPOST pathPattern:@"/xxx/response.php/json/response"
keyPath:nil statusCodes:RKStatusCodeIndexSetForClass(RKStatusCodeClassSuccessful)];