I am getting this error on generating an NSManagedObject in Xcode 8.1 in Swift.
:0: error: filename \"DemoOne+CoreDataClass.swift\" used twice: \'/Us
May help someone, Go to project compile source delete the extra reference if any.
Select code data model then select the Entity change the value of 'Codegen' to Manual/None.
It will work.
I just restart my Macbook and that clean my build folder. And it works like a charm!
The issue was due a second file named:"Extensions.swift" in my project.
After deleting the duplicate "Extensions.swift" the error got resolved. Your error message might tell you which file is duplicated.
In my case Data Model (as example: MyCoreData.xcdatamodeld) was listed twice under Editor -> Create NSManagedObject Subclass... And here was reason why it was getting this type of error.
What I did:
It happened to me when I copied and renamed entity. It failed to rename the class, so do it manually.