iPhone - isKindOfClass 生成链接器错误
我有一个这样定义的类:
@interface ServerCall : NSObject {
// vars
}
// properties
// functions (init)
@end
并且
@interface ServerNotification : ServerCall {
// just vars
}
@end
我在另一个类中进行了调用:
if ([call isKindOfClass:[ServerNotification class]])
// do things
构建时出现此错误:
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ServerNotification", referenced from:
objc-class-ref in ServerCommunication.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
"_OBJC_CLASS_$_ServerNotification", referenced from:
objc-class-ref in ServerCommunication.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
我在构建设置中也有“默认隐藏的符号”=否
我错过了什么?
I have a class defined like this :
@interface ServerCall : NSObject {
// vars
}
// properties
// functions (init)
@end
and
@interface ServerNotification : ServerCall {
// just vars
}
@end
I have a call in another class :
if ([call isKindOfClass:[ServerNotification class]])
// do things
When building I have this error :
Undefined symbols for architecture i386:
"_OBJC_CLASS_$_ServerNotification", referenced from:
objc-class-ref in ServerCommunication.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
"_OBJC_CLASS_$_ServerNotification", referenced from:
objc-class-ref in ServerCommunication.o
ld: symbol(s) not found for architecture i386
collect2: ld returned 1 exit status
I also have in build settings "Symbols hidden by default" = NO
What did I miss ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
链接器找不到您的
ServerNotification
类的实现。您是否已将匹配的实现文件添加到您的目标中?The linker doesn't find implementations for your
ServerNotification
class. Do you have the matching implementation file added to your target?