Skip to content

Commit

Permalink
Merge pull request #36 from ealeksandrov/swift-class-fix
Browse files Browse the repository at this point in the history
RLMObject+Copying Swift fix
  • Loading branch information
matthewcheok committed Apr 3, 2015
2 parents 8683f11 + 68c42cd commit 26a42aa
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions Realm+JSON/RLMObject+Copying.m
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,7 @@ @interface RLMProperty (Copying_Internal)
@implementation RLMObject (Copying)

- (instancetype)shallowCopy {
Class class = NSClassFromString([[self class] className]);

id object = [[class alloc] init];
id object = [[[self class] alloc] init];
[object mergePropertiesFromObject:self];

return object;
Expand All @@ -45,9 +43,7 @@ - (void)mergePropertiesFromObject:(id)object {
}

- (instancetype)deepCopy {
Class class = NSClassFromString([[self class] className]);

RLMObject *object = [[class alloc] init];
RLMObject *object = [[[self class] alloc] init];

for (RLMProperty *property in self.objectSchema.properties) {

Expand Down

0 comments on commit 26a42aa

Please sign in to comment.