构建iOS的OCUnit应用程序测试目标时的链接器错误

问题描述:

我的OCUnit目标中包含应用程序测试。我可以在应用程序主机目标中的类上调用实例方法,但我无法调用类方法。如果我把一个类的方法(如alloc),我得到下面的连接错误:构建iOS的OCUnit应用程序测试目标时的链接器错误

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

+0

我会展开调查。这听起来似乎合理。 –