Created
April 18, 2012 14:46
-
-
Save yood/2414047 to your computer and use it in GitHub Desktop.
Modify mogenerator header template for transformable NSRange attribute
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
diff --git a/misc/machine.h.motemplate b/misc/machine.h.motemplate | |
index 4715701..9c51a9a 100644 | |
--- a/misc/machine.h.motemplate | |
+++ b/misc/machine.h.motemplate | |
@@ -5,7 +5,7 @@ | |
<$if hasCustomSuperentity$>#import "<$customSuperentity$>.h"<$endif$> | |
<$foreach Relationship noninheritedRelationships do$>@class <$Relationship.destinationEntity.managedObjectClassName$>; | |
<$endforeach do$> | |
-<$foreach Attribute noninheritedAttributes do$><$if Attribute.hasTransformableAttributeType$>@class <$Attribute.objectAttributeType$>;<$endif$> | |
+<$foreach Attribute noninheritedAttributes do$><$if Attribute.hasTransformableAttributeType && Attribute.objectAttributeClassName != "NSRange" $>@class <$Attribute.objectAttributeClassName$>;<$endif$> | |
<$endforeach do$> | |
@interface _<$managedObjectClassName$> : <$customSuperentity$> | |
@@ -16,12 +16,16 @@ | |
<$foreach Attribute noninheritedAttributes do$> | |
<$if Attribute.hasDefinedAttributeType$> | |
+<$if Attribute.hasTransformableAttributeType && Attribute.objectAttributeClassName == "NSRange" $> | |
+@property (nonatomic, assign) <$Attribute.objectAttributeClassName$> <$Attribute.name$>; | |
+<$else$> | |
<$if TemplateVar.arc$> | |
@property (nonatomic, strong) <$Attribute.objectAttributeType$> <$Attribute.name$>; | |
<$else$> | |
@property (nonatomic, retain) <$Attribute.objectAttributeType$> <$Attribute.name$>; | |
<$endif$> | |
<$endif$> | |
+<$endif$> | |
<$endforeach do$> | |
<$foreach Relationship noninheritedRelationships do$> | |
<$if Relationship.isToMany$> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment