开发者

iPhone - isKindOfClass generates a linker error

开发者 https://www.devze.com 2023-03-13 18:40 出处:网络
I have a class defined like this : @interface ServerCall : NSObject { // vars } // properties // functions (init)

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 开发者_JAVA技巧returned 1 exit status

I also have in build settings "Symbols hidden by default" = NO

What did I miss ?


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

0

精彩评论

暂无评论...
验证码 换一张
取 消