我的json响应如下:
[
{
"DateOfBirth": "1951-08-02T00:00:00",
"Age": "65",
"Gender": "Female",
"FirstName": "abc",
"LastName": "xyz"
}
]
顶层没有任何密钥。
RKObjectMapping *entityMapping = [RKObjectMapping mappingForClass:[MyEntityModel class]];
[entityMapping addAttributeMappingsFromDictionary:@{ @"DateOfBirth": @"dateOfBirth",
@"Age": @"age",
@"Gender": @"gender",
@"FirstName": @"firstName",
@"LastName": @"lastName"
}];
RKResponseDescriptor *descriptor = [RKResponseDescriptor responseDescriptorWithMapping:patientMatchingMapping method:RKRequestMethodGET pathPattern:nil keyPath:nil statusCodes:code];
这不会映射对象,并且在实体类中具有空映射。如何映射此类响应?