diff --git a/Realm+JSON/RLMObject+Copying.m b/Realm+JSON/RLMObject+Copying.m index 0a88a51..370ab0b 100644 --- a/Realm+JSON/RLMObject+Copying.m +++ b/Realm+JSON/RLMObject+Copying.m @@ -11,6 +11,12 @@ #import #import +@interface RLMProperty (Copying_Internal) + +@property (nonatomic, assign) BOOL isPrimary; + +@end + @implementation RLMObject (Copying) - (instancetype)shallowCopy { @@ -31,7 +37,7 @@ - (void)mergePropertiesFromObject:(id)object { [thisArray addObjects:thatArray]; } // assume data - else { + else if (!property.isPrimary) { id value = [object valueForKeyPath:property.name]; [self setValue:value forKeyPath:property.name]; }