Skip to content

Commit fd0f6b6

Browse files
authored
Add nullability to the primitive value
A defined attribute can be nullable, so the getter and setter of the primitive should consider nullable
1 parent 5fb4229 commit fd0f6b6

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

templates/machine.h.motemplate

+2-2
Original file line numberDiff line numberDiff line change
@@ -146,8 +146,8 @@ NS_ASSUME_NONNULL_BEGIN
146146
@interface _<$managedObjectClassName$> (CoreDataGeneratedPrimitiveAccessors)
147147
<$foreach Attribute noninheritedAttributesSansType do$>
148148
<$if Attribute.hasDefinedAttributeType$>
149-
- (<$Attribute.objectAttributeType$>)primitive<$Attribute.name.initialCapitalString$>;
150-
- (void)setPrimitive<$Attribute.name.initialCapitalString$>:(<$Attribute.objectAttributeType$>)value;
149+
- (<$if Attribute.optional$>nullable <$endif$><$Attribute.objectAttributeType$>)primitive<$Attribute.name.initialCapitalString$>;
150+
- (void)setPrimitive<$Attribute.name.initialCapitalString$>:(<$if Attribute.optional$>nullable <$endif$><$Attribute.objectAttributeType$>)value;
151151
<$if Attribute.hasScalarAttributeType$>
152152
- (<$Attribute.scalarAttributeType$>)primitive<$Attribute.name.initialCapitalString$>Value;
153153
- (void)setPrimitive<$Attribute.name.initialCapitalString$>Value:(<$Attribute.scalarAttributeType$>)value_;

0 commit comments

Comments
 (0)