mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 04:20:21 +08:00
Add support for performing object mapping with type transformations across relationships defined with keyPaths
This commit is contained in:
@@ -270,6 +270,18 @@ NSString * const RKObjectMappingNestingAttributeKeyName = @"<RK_NESTING_ATTRIBUT
|
||||
return [[RKPropertyInspector sharedInspector] typeForProperty:propertyName ofClass:self.objectClass];
|
||||
}
|
||||
|
||||
- (Class)classForKeyPath:(NSString *)keyPath
|
||||
{
|
||||
NSArray *components = [keyPath componentsSeparatedByString:@"."];
|
||||
Class propertyClass = self.objectClass;
|
||||
for (NSString *property in components) {
|
||||
propertyClass = [[RKPropertyInspector sharedInspector] typeForProperty:property ofClass:propertyClass];
|
||||
if (! propertyClass) break;
|
||||
}
|
||||
|
||||
return propertyClass;
|
||||
}
|
||||
|
||||
#pragma mark - Date and Time
|
||||
|
||||
- (NSFormatter *)preferredDateFormatter
|
||||
|
||||
Reference in New Issue
Block a user