【发布时间】:2013-01-15 16:41:48
【问题描述】:
有没有办法抑制编译错误? 在这种情况下,我无法使用协议,因为我尝试使用的类位于外部库中。我无法控制代码
if (myClass && [[myClass class] respondsToSelector:@selector(getSomething)])
{
// Compile error on the line below
MyResult *result = [myClass getSomething];
// Also tried
MyResult *result = [(id)myClass getSomething];
}
编辑: 错误:没有已知的选择器类方法
【问题讨论】:
-
GDB 和 LLDB 是调试器,而不是编译器。 Apple 支持的编译器是 GCC 和 Clang。
-
lldb & gdb 和编译有什么关系?除此之外,还有什么错误?
-
你遇到了什么错误?
-
编译器不知道您尝试使用的类方法。你
#import找对文件了吗? -
@zneak 但是这个类可以是任何东西,我想在任何响应它的类上调用那个方法
标签: objective-c compiler-errors compiler-warnings