mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-23 04:20:21 +08:00
Updated Object Mapping documentation, added support for inferring object mappings based off of the type of the object used in postObject:, putObject:, etc. Made KVC validation optional.
This commit is contained in:
@@ -52,6 +52,7 @@
|
||||
|
||||
- (void)registerMapping:(RKObjectMapping*)objectMapping withRootKeyPath:(NSString*)keyPath {
|
||||
// TODO: Should generate logs
|
||||
objectMapping.rootKeyPath = keyPath;
|
||||
[self setObjectMapping:objectMapping forKeyPath:keyPath];
|
||||
RKObjectMapping* inverseMapping = [objectMapping inverseMapping];
|
||||
inverseMapping.rootKeyPath = keyPath;
|
||||
@@ -75,7 +76,8 @@
|
||||
}
|
||||
|
||||
- (RKObjectMapping*)objectMappingForClass:(Class)theClass {
|
||||
return [[self objectMappingsForClass:theClass] objectAtIndex:0];
|
||||
NSArray* objectMappings = [self objectMappingsForClass:theClass];
|
||||
return ([objectMappings count] > 0) ? [objectMappings objectAtIndex:0] : nil;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
Reference in New Issue
Block a user