我有一个像这样定义的类:
@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
我在构建设置中也有“默认情况下隐藏的符号”= NO
我错过了什么?
答案 0 :(得分:1)
链接器找不到ServerNotification
类的实现。您是否已将匹配的实施文件添加到目标中?