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

Incorrect header generated #93

Closed
jdmuys opened this issue Feb 20, 2012 · 4 comments
Closed

Incorrect header generated #93

jdmuys opened this issue Feb 20, 2012 · 4 comments

Comments

@jdmuys
Copy link

jdmuys commented Feb 20, 2012

Hi,

I just upgraded to 1.25 and started a new project, where the generated machine headers are wrong. For String and Date attributes, mogenerator generates:

@property (nonatomic, strong) NSDatedate;
@property (nonatomic, strong) NSStringkind;

Where clearly a space and a * is missing.

Indeed, the template has:

@property (nonatomic, strong) <$Attribute.objectAttributeType$><$Attribute.name$>;

Did I miss anything?

I invoke mogenerator with this script line:

mogenerator --template-var frc=true --template-var arc=true --model "${INPUT_FILE_PATH}/${INPUT_FILE_BASE}.xcdatamodel" --output-dir "${INPUT_FILE_DIR}/" --base-class JDManagedObject

Thanks

@jdmuys
Copy link
Author

jdmuys commented Feb 20, 2012

If I "fix" the template (adding a * and space), then similar bad code is generated by those two lines:

- (<$Attribute.objectAttributeType$>)primitive<$Attribute.name.initialCapitalString$>;
- (void)setPrimitive<$Attribute.name.initialCapitalString$>:(<$Attribute.objectAttributeType$>)value;

Where the * is missing too.

So I add the missing * there, and now, the generated code compiles fine.

I forgot to mention this is with Xcode 4.4dp1

@rentzsch
Copy link
Owner

Make sure you're using the latest mogenerator via mogenerator --version and make sure you're on the latest templatesm pulling from https://github.com/rentzsch/mogenerator/tree/master/templates if need be.

@jdmuys
Copy link
Author

jdmuys commented Feb 20, 2012

The lines I quoted are straight from github. As I wrote, I just upgraded to 1.25 (using homebrew). It turns out that when you do that, the homebrew version doesn't replace the previously installed version. So 1.24 was still being run! (I had previously installed 1.24 using the installer).

The only suggestion I have to prevent that from happening, is to tag the templates with the version of mogenerator they are supposed to run with, and for mogenerator to check and warn if it finds a discrepancy.

Of course, this is an edge case...

@jdmuys jdmuys closed this as completed Feb 20, 2012
@rentzsch
Copy link
Owner

Eventually the default templates will be built into the mogenerator binary (#79) so this won't be an issue in the future.

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

2 participants