I was trying to create NSManagedObject subclasses (2 related entities) automatically in Xcode. They are generated like this:
You need to remove the CoreData related sub class generated by yourself, and you can keep the #import line with those classes, now all those files will be generated automatically when build the project.