ios “_OBJC_CLASS_$_”,引用自:xcode 4.3.2 中的错误
声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow
原文地址: http://stackoverflow.com/questions/10302522/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me):
StackOverFlow
“_OBJC_CLASS_$_”, referenced from: error in xcode 4.3.2
提问by Ashan Marla
So today I ran into a major problem. I got a problem involving my viewcontroller on xcode 4.3.2 as seen in this error message:
所以今天我遇到了一个大问题。如此错误消息所示,我在 xcode 4.3.2 上遇到了涉及我的视图控制器的问题:
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)
I noticed that these errors only appear when I program IBActions linking my viewcontroller to additional classes. If I delete the IBActions the errors disappear. Any help is appreciated.
我注意到这些错误仅在我编写 IBActions 将我的视图控制器链接到其他类时才会出现。如果我删除 IBActions,错误就会消失。任何帮助表示赞赏。
回答by Ashan Marla
Finally found the answer. In your target settings, locate build phases and navigate to compile sources. Once there just ad the .m file that is getting the error to the list.
终于找到了答案。在您的目标设置中,找到构建阶段并导航到编译源。一旦出现,将出现错误的 .m 文件添加到列表中。
回答by chakri Reddy
For me the following method worked.
对我来说,以下方法有效。
In target -> Build Phases -> Compile Sources I had all .m files including those that were giving issue.
在目标 -> 构建阶段 -> 编译源中,我拥有所有 .m 文件,包括那些出现问题的文件。
Simply I removed those .m files which were giving issue.
只是我删除了那些出现问题的 .m 文件。