Solve the problem of duplicate symbol error when using CoreData

I don’t know which XCode version I adjusted to CoreData. I used XCode9.2. I added the entity according to the original steps, and then used the menu Editor->Create NSManagedObject Subclass... to generate the entity class. Compilation will report "duplicate symbol" error. At first glance, there is no duplicate reference type found, and this error comes out inexplicably. Later, I found a solution through Stackoverflow:

1. Select an entity in your data model file xcdatamodeld.

2. Then switch Data Model Inspector in the right column of XCode (the third column)

3. Replace the Class Definition with Manual/None in the Codegen column, which means that the entity type definition is not automatically generated. As shown:


4. Recompile.

Guess you like

Origin blog.csdn.net/niumanxx/article/details/79115184