Skip to content
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

Can't use property name enums in Swift. #218

Closed
Scenario opened this issue Jul 10, 2014 · 3 comments
Closed

Can't use property name enums in Swift. #218

Scenario opened this issue Jul 10, 2014 · 3 comments

Comments

@Scenario
Copy link

When using the Swift template in 1.28, the Swift compiler in Xcode Beta 3 will not allow the use of your auto-generated string constants for property names. It issues the error "'MyEntityAttributes' is not convertible to 'String'" on any line of code like this one:

if anInstanceOfMyEntity.valueForKey(MyEntityAttributes.aProperty).integerValue != whatever

Is this an Apple bug or a mogenerator bug?

@Scenario Scenario changed the title Can't use property Can't use property name enums Jul 10, 2014
@Scenario Scenario changed the title Can't use property name enums Can't use property name enums in Swift Jul 10, 2014
@Scenario Scenario changed the title Can't use property name enums in Swift Can't use property name enums in Swift. Jul 10, 2014
@tonyarnold
Copy link
Contributor

Currently, you need to say MyEntityAttributes.aProperty.toRaw() — I've opened PR #221 / #222 to allow you to use the syntax you're expecting above.

@Scenario
Copy link
Author

Awesome, can't wait to use it!

@justin
Copy link
Collaborator

justin commented Mar 22, 2016

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!

@justin justin closed this as completed Mar 22, 2016
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants