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:
Blake Watters
2011-07-23 23:44:21 -04:00
parent 80366afa84
commit 570b13ca07
14 changed files with 865 additions and 341 deletions

View File

@@ -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