Update designated initializer for RKObjectMapping

This commit is contained in:
Blake Watters
2012-08-29 18:59:51 -04:00
parent 9089bb4ed0
commit eabfd748b6
2 changed files with 5 additions and 4 deletions

View File

@@ -131,6 +131,8 @@ relationship. Relationships are processed using an object mapping as well.
*/
+ (id)mappingForClass:(Class)objectClass;
- (id)initWithClass:(Class)objectClass; // Designated initializer
/**
Returns an object mapping useful for configuring a serialization mapping. The object
class is configured as NSMutableDictionary

View File

@@ -48,9 +48,7 @@ NSString * const RKObjectMappingNestingAttributeKeyName = @"<RK_NESTING_ATTRIBUT
+ (id)mappingForClass:(Class)objectClass
{
RKObjectMapping *mapping = [self new];
mapping.objectClass = objectClass;
return mapping;
return [[self alloc] initWithClass:objectClass];
}
+ (id)requestMapping
@@ -58,10 +56,11 @@ NSString * const RKObjectMappingNestingAttributeKeyName = @"<RK_NESTING_ATTRIBUT
return [self mappingForClass:[NSMutableDictionary class]];
}
- (id)init
- (id)initWithClass:(Class)objectClass
{
self = [super init];
if (self) {
self.objectClass = objectClass;
self.mutablePropertyMappings = [NSMutableArray new];
self.setDefaultValueForMissingAttributes = NO;
self.setNilForMissingRelationships = NO;