Duplicate files in DerivedData folder using CoreData generator

后端 未结 7 1802
庸人自扰
庸人自扰 2020-12-28 13:29

I\'m trying to generate NSManagedModels from my datamodel. Generation works but after I got many errors :

error: filename \"Station+CoreDataProperties

7条回答
  •  野趣味
    野趣味 (楼主)
    2020-12-28 14:14

    For the sake of completeness..:

    I just ran into the same error, but none of the proposed solutions worked. What puzzled me was that even switching from automated code generation to manual for the one (as I thought) problematic entity didn't do anything.

    Finally, I figured out that I had several entities with the same name, but they all shared the same classname. The reason for this was that I copy&pasted one entity several times to save me some work, because they also have a few attributes in common.

    Turns out XCode renames the duplicates by adding 1, 2,... to the entity name, but leaves the class name as before. And since now entity name and class name are "unrelated", renaming the entity won't change the class name either.

    Hope it helps someone - I have also filed a bug report for this.

提交回复
热议问题