Xcode“未声明的标识符的使用”错误,编译/运行就好了 [英] Xcode "Use of undeclared identifier" errors, compiles/runs just fine

查看:505
本文介绍了Xcode“未声明的标识符的使用”错误,编译/运行就好了的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个令人难以置信的讨厌的问题,阻碍我的工作流程。在我的项目中,我有未声明标识符的用户错误。他们都参考一个类,特别是一个Theme类。我检查任何循环引用我的导入,没有。我真的很困惑。

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...

我已尝试清理,删除派生数据...任何想法?

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

推荐答案

我有同样的问题,并注意到所有未声明的标识符在我的pch文件中的文件中声明。

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

考虑到这一点,我从pch文件中删除了一个#import行,并重新编译,失败了预期。然后我把删除的行重新编译,重新编译,并正常编译所有的错误错误了。

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.

这篇关于Xcode“未声明的标识符的使用”错误,编译/运行就好了的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆