'Dog' is ambiguous for type lookup in this context

Guys, I’m so annoyed by this error !

I’m on the page 73 of the Core Data by tutorials book, and when I’m creating the NSManagedOject, Xcode is giving big times errors…

It’s not the first time I get this, and I have no clue what’s going on…

I think this is an issue introduced by XCode 8.1. I haven’t figured out a fix yet…

I know what the issue is : it’s the way xcode handles the classes of the managedobject. I’m not on my mac so I can’t tell you where it is but you have to go in the “Interface Builder” and then click on your entity, in the property you have things like “manual/none ; class/xxx”. It has to be manual/none, but when you change it, it doesn’t save that parameter.

Yes, I discovered that “Manual/None” thing. Even when doing that, I still have the issue (for me, it shows on Chapter 2, page 47). Deleting the Bowtie+…swift files allows me to compile and run the test on p. 47 but I suspect it will give me other issues later on… One issue at the time I guess!

1 Like

Hello,

To solve the issue with Dog is ambiguous for … (same as Bow ties)
I have modified in the data model inspector the following fields :
Class → module to current Product Module and Class → codegen to Manual/None.
With these modifications, I get no compile error but when running the project I got an uncaught exception : calls Dog don’ts have a NSEntityDescription.
When I comment the line @objc(Dog) in the Dog+CorDataClass.swift, the app run without problem.
I am wondering why the @objc(Dog) impact the app?

My response to this post may be helpful: Chapter 2: Error 'Bowtie' is ambiguous for type lookup in this context - #2 by harri

1 Like

I agree with that Class → module to current Product Module and Class → codegen to Manual/None.

1 Like

Hey all! Thanks for letting us know about this problem and for helping others out.

We’ve updated Chapters 2 and 3 of the book to help avoid this issue under Xcode 8.1:

https://www.raywenderlich.com/148554/core-data-tutorials-updated

All Core Data by Tutorials PDF customers get this as a free update!

Sorry @crispy8888 but in my case (version 3.1 of the book), this error still hasn’t been fixed. Screenshot and details here.

I also have v3.1 and ran into the issue - but here is my fix…

Even though you may have selected “Manual/None” for the Codegen, this setting may have not been saved!

Head back to your Dog Walk.xcdatamodeld, select your entities one at a time and re-select the Manual/None for your Codegen property on each.

Now SAVE - (cmd -S) (the root of the issue ?)
and then do the Editor > Create NSManagedObject Subclass

Clean > Rebuild > Smile

2 Likes

Restarting the Xcode is useful to me!