--base-class-import option not including #import in generated files #220

Closed
eytanbiala opened this Issue Jul 11, 2014 · 1 comment

2 participants

@eytanbiala

I am trying to import a file in all of my Mogenerator generated classes using --base-class-import.

Here is the Run script I am using:

 mogenerator -m Project/Data/Model/model.xcdatamodeld -O Project/Data/Managed\ Object --template-var arc=true --base-class-import "Project/Categories/NSManagedObject+Extras.h"

I've tried without the full path (just the class name), and also with single quotes, and no quotes:

 mogenerator -m Project/Data/Model/model.xcdatamodeld -O Project/Data/Managed\ Object --template-var arc=true --base-class-import "NSManagedObject+Extras.h"

However this doesn't regenerate the files.

Everything does work fine without --base-class-import:

mogenerator -m Project/Data/Model/model.xcdatamodeld -O Project/Data/Managed\ Object --template-var arc=true

Am I missing something, or what else can I try?

@chao787

I got the same problem.

I think the author's original idea was to import base class from a different header, not the for the NSManagedobject's category.

And what we want mainly from mogenerator is auto and subclass, for its flexibility on comparison with category.

And, if you insist on category:

You can do with:

mogenerator -m Project/Data/Model/model.xcdatamodeld -O Project/Data/Managed\ Object --template-var arc=true --base-class NSManagedObject --base-class-import "NSManagedObject+Extras.h"

To denote with NSManagedObject as --base-class to bypass this.

I got the same question from here:
http://stackoverflow.com/questions/24689768

@eytanbiala eytanbiala closed this Aug 18, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment