invalid redeclaration in auto code generate NSManagedObject Subclass Swift 3

In Xcode 8.1, before using the auto code generator, you must select the entity in your data model:

Entity

Then go to the Data Model Inspector tab:

Data Model Inspector

Under “Codegen” select “Manual/Node”

After that you could create a NSManagedObject subclass without errors.


Alternatively, if you have already used ‘Class Definition’, you can go into your existing .xcdatamodeld file and set all current entities to ‘Manual/None’ under Codegen. Make sure to save your project (File -> Save), delete your existing Derived Data, clean the project, and then build. Resolved it for me without having to re-make my whole model.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)