-
Notifications
You must be signed in to change notification settings - Fork 395
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
propertyDescription.optional not set because XML attribute is not present #286
Comments
mkalinowski
pushed a commit
to mkalinowski/mogenerator
that referenced
this issue
Nov 20, 2015
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
rentzsch
pushed a commit
that referenced
this issue
Mar 3, 2016
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! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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: