在 Restkit v0.10 中,可以使用从https://stackoverflow.com/a/12057398/871459获取的以下代码来完成到 NSDictionary 的映射
RKObjectMapping* mapping = [RKDynamicObjectMapping dynamicMapping];
mapping.objectMappingForDataBlock = ^(id data) {
NSDictionary* object = [data objectForKey: @"object"];
NSArray* keys = [object allKeys];
RKObjectMapping* dataMapping = [RKObjectMapping objectMapping];
//Use the keys to define mapping
return dataMapping;
};
在 v0.20 中,这不再可能。如何在 Restkit v0.20 上实现相同的功能?