{
"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 クラスを使用してマップされます
ジョブ クラスの folderversion 配列に FolderVersions をマップしたい
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)];