You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
the generated classes do have the NSNumber type for bool an double values. In xcode there is a way to check "Use scalar properties for primitive data types" - is there a way to realize this with mogenerator, too?
I want to use model.isCkecked = YES to set the value for a bool.
The text was updated successfully, but these errors were encountered:
You didn't say what language you're using, but since you use YES rather than true it looks like you mean Objective-C.
With ObjC, your generated code should include a property called isCheckedValue of type BOOL, which you can use as you describe. If you're actually using Swift, this change is coming in the delayed-but-not-forgotten swift42 branch of this project.
Thank for your fast answer. I'm using objective-c.
It's a huge project with an existing core data with a huge amount of entities and classes.
I want to migrate to generated files from mogenerator - but I don't want to change all lines of codes from (example) isChecked to isCheckedValue - is here a way to use this optionals as I did before?
You can get what you describe but only if the isChecked property is configured to use scalar types and is not configured as "optional" in the data model.
If the attribute meets both of those requirements, you can then add --template-var scalarsWhenNonOptional=true as one of the arguments when running mogenerator. Then you'll get the following generated property:
Hi there,
the generated classes do have the NSNumber type for bool an double values. In xcode there is a way to check "Use scalar properties for primitive data types" - is there a way to realize this with mogenerator, too?
I want to use
model.isCkecked = YES
to set the value for a bool.The text was updated successfully, but these errors were encountered: