I did a core-data model:
class Order: NSManagedObject {
... //code
}
but when I try to build I get an error:
'Order' is ambiguous for type lookup in this context
I did a core-data model:
class Order: NSManagedObject {
... //code
}
but when I try to build I get an error:
'Order' is ambiguous for type lookup in this context
so I figured - the Entity 'Order' should be defined in the core data properties panel.
open core data .xcdatamodeld file
select the Entity 'Order'
On the right select "Current Product Module" under module
select "Category/Extension" under Codegen
Below are steps that worked for me,
I feel the right solution is to delete the files created by Xcode foe the entity class and attribute class and change the codegen to class definition.
Make sure to clean your build folder also once you make the required changes to your entity settings.
I had the same issue, on codegen option i had choosen class defination,To fix this: 1.Delete the generated class files 2. Select the Order Entity and on codegen on your right hand side choose manual\none 3. Navigate to Xcode Editor and select "Create NSManagedObject subclass to generate the classes again.
In my case I had an entity named "Client". Client seems to be used internally under the hood somewhere. Changing the entity name to "Company" resolved the issue.
So check if your naming is reserverd by the system or other components.
Be sure to change both entity and class name (at least the class name).
The accepted answer by @aviram-netanel worked for me, but I had a hard time finding the panel lol.
.xcdatamodeld
file© 2022 - 2025 — McMap. All rights reserved.