在为iOS构建OCUnit应用程序测试目标时出现链接器错误

时间:2011-08-26 20:24:52

标签: objective-c ios ocunit

我的OCUnit目标中包含了一个Application Test。我可以在Application Host目标中的类上调用实例方法,但是我不能调用类方法。如果我调用类方法(如alloc),我会收到以下链接器错误:

Undefined symbols for architecture armv6:
  "_OBJC_CLASS_$_DiceGameViewController", referenced from:
      objc-class-ref in DiceGameViewControllerTest.o
     (maybe you meant: _OBJC_CLASS_$_DiceGameViewControllerTest)
ld: symbol(s) not found for architecture armv6
collect2: ld returned 1 exit status

我认为这是因为Objective-C在链接时不需要访问目标文件来进行实例调用,但是在链接时需要访问类调用。有人能指出我的文件来证实这一点吗?

这个问题类似于这些问题:

Imported files not recognized in OCUnit

OCUnit will not allow me to use my own data types

1 个答案:

答案 0 :(得分:1)