“_OBJC_CLASS _ $ _”,引自:xcode 4.3.2中的错误

时间:2012-04-24 17:00:19

标签: ios xcode

所以今天我遇到了一个重大问题。我在xcode 4.3.2上遇到了涉及我的viewcontroller的问题,如以下错误信息所示:

Undefined symbols for architecture i386: "_OBJC_CLASS_$_SecondViewController",
referenced from: objc-class-ref in Birdflix_ProViewController.o "_OBJC_CLASS_$_ThirdViewController", 
referenced from: objc-class-ref in Birdflix_ProViewController.o "_OBJC_CLASS_$_FourthViewController",
referenced from: objc-class-ref in Birdflix_ProViewController.o "_OBJC_CLASS_$_Author",
referenced from: objc-class-ref in Birdflix_ProViewController.o
ld: symbol(s) not found for architecture i386 clang: error: linker command failed with exit code 1 (use -v to see invocation)

我注意到这些错误仅在我编写将我的viewcontroller链接到其他类的IBActions时出现。如果我删除IBActions,错误就会消失。任何帮助表示赞赏。

2 个答案:

答案 0 :(得分:91)

终于找到了答案。在目标设置中,找到构建阶段并导航到编译源。一旦只是将正在获取错误的.m文件添加到列表中。

答案 1 :(得分:0)

对我来说,以下方法有效。

目标 - >构建阶段 - >编译源我拥有所有.m文件,包括那些提出问题的文件。

我只是删除了那些提出问题的.m文件。