iPhone - isKindOfClass 生成链接器错误

发布于 2024-11-15 20:31:34 字数 851 浏览 1 评论 0原文

我有一个这样定义的类:

@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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

扶醉桌前 2024-11-22 20:31:34

链接器找不到您的 ServerNotification 类的实现。您是否已将匹配的实现文件添加到您的目标中?

The linker doesn't find implementations for your ServerNotification class. Do you have the matching implementation file added to your target?

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文