mirror of
https://github.com/zhigang1992/RestKit.git
synced 2026-04-30 21:52:30 +08:00
Update designated initializer for RKObjectMapping
This commit is contained in:
@@ -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
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user