From fdc4a02c2180493d24a68fddc98ddd35b1fc1277 Mon Sep 17 00:00:00 2001 From: Tony Arnold Date: Thu, 11 Nov 2010 19:18:13 +1100 Subject: [PATCH] Adding keyPathsForValuesAffectingValueForKey for scalar *Value properties. --- templates/machine.m.motemplate | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/templates/machine.m.motemplate b/templates/machine.m.motemplate index d76d64d4..709b1fcf 100644 --- a/templates/machine.m.motemplate +++ b/templates/machine.m.motemplate @@ -26,6 +26,17 @@ return (<$managedObjectClassName$>ID*)[super objectID]; } ++ (NSSet *)keyPathsForValuesAffectingValueForKey:(NSString *)key { + NSSet *keyPaths = [super keyPathsForValuesAffectingValueForKey:key]; + <$foreach Attribute noninheritedAttributes do$><$if Attribute.hasDefinedAttributeType$><$if Attribute.hasScalarAttributeType$> + if ([key isEqualToString:@"<$Attribute.name$>Value"]) { + NSSet *affectingKey = [NSSet setWithObject:@"<$Attribute.name$>"]; + keyPaths = [keyPaths setByAddingObjectsFromSet:affectingKey]; + }<$endif$><$endif$><$endforeach do$> + + return keyPaths; +} + <$foreach Attribute noninheritedAttributes do$> <$if Attribute.hasDefinedAttributeType$>