Search code examples
iphoneiosxcodeipadcompiler-errors

Xcode "Use of undeclared identifier" errors, compiles/runs just fine


I've got an incredibly annoying issue that is hampering my workflow. In my project I have "User of undeclared identifier" errors all over. They are all in reference to a single class, specifically a Theme class. I checked for any circular referencing with my imports, none. I'm really confused.

Here is a screenshot of the errors. I would post errors in the Build Log for more detail, but there aren't any. It builds and runs just fine...

enter image description here

I've tried cleaning, deleting the derived data... Any ideas?


Solution

  • I was having the same problem and noticed that all of the undeclared identifiers were declared in files that were in my pch file.

    With this in mind I deleted one of the #import lines from the pch file and recompiled which failed as expected. I then put the deleted line back in, recompiled and it compiled normally with all the false errors gone.

    Hopefully this simple solution helps a few of you out if the above solutions don't.