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

Ash*_*rla 40 xcode ios

所以今天我遇到了一个重大问题.我在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)
Run Code Online (Sandbox Code Playgroud)

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

Ash*_*rla 94

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

  • 另一件事是确保在复制/添加任何资源时选择"目标"而不是"构建和测试" (3认同)