drewmccormack / ensembles

A synchronization framework for Core Data.
MIT License
1.63k stars 131 forks source link

The same global ids for different entities does not work in version 1.x #190

Open drewmccormack opened 9 years ago

drewmccormack commented 9 years ago

Using the same global id in two different entities, even when they are not parent-children, does not work in v1.x. It gives an error on merging for this code:

- (void)setValue:(id)value forKey:(NSString *)key inObject:(id)object
{
    id currentValue = [self valueForKey:key inObject:object];
   if (value != currentValue && ![value isEqual:currentValue]) {
        [object willChangeValueForKey:key];
--->    [object setPrimitiveValue:value forKey:key];
        [object didChangeValueForKey:key];
    }
}

Error is Unacceptable type of value for to-one relationship: property = "..."; desired type = AnEntity; given type = AnotherEntity; value = ...

Suspicious code is