Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Adding keyPathsForValuesAffectingValueForKey for scalar *Value proper…

…ties.
  • Loading branch information...
commit fdc4a02c2180493d24a68fddc98ddd35b1fc1277 1 parent 12298a8
Tony Arnold tonyarnold authored
Showing with 11 additions and 0 deletions.
  1. +11 −0 templates/machine.m.motemplate
11 templates/machine.m.motemplate
View
@@ -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$>
Please sign in to comment.
Something went wrong with that request. Please try again.