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
I was wondering why, after incorporating the changes of #245, my Swift machine files didn't use optionality correctly. So I did a couple of tests and I think I found a bug.
Currently mogenerator uses something like this to create NSPropertyDescription (and others) from the XML CoreData model:
Unfortunately the Xcode model editor does not create an optional xml attribute if the core data attribute is not optional. So propertyDescription.optional is never set. So it is still set to its default value. Which in this case is YES, which is the exact opposite from what it should be.
The text was updated successfully, but these errors were encountered:
Xcode omits the optional attribute in its XML model output if
it is set to not-optional, but `NSPropertyDescription.optional`
defaults to YES.
To be on the safe side I decided to treat all Booleans the same.
Currenlty only optional was affected, because it's the only
attribute which default is YES.
That should fix issue rentzsch#286
If the scalarsWhenNonOptional template var is set to true, and an Attribute is not optional (requires fix for #286), then we'll generate accessor/mutator methods using the plain attribute name rather than with the Value suffix.
We are declaring pull request and issue 0 now that 1.3 is out. If this is still an issue you'd like to see address with 1.30 and going forward, please open a new issue so we can start a fresh discussion. Thank you!
I was wondering why, after incorporating the changes of #245, my Swift machine files didn't use optionality correctly. So I did a couple of tests and I think I found a bug.
Currently mogenerator uses something like this to create
NSPropertyDescription
(and others) from the XML CoreData model:Unfortunately the Xcode model editor does not create an
optional
xml attribute if the core data attribute is not optional. SopropertyDescription.optional
is never set. So it is still set to its default value. Which in this case isYES
, which is the exact opposite from what it should be.The text was updated successfully, but these errors were encountered: