我的 OCUnit 目标中包含一个应用程序测试。我可以在我的应用程序主机目标中的类上调用实例方法,但我不能调用类方法。如果我调用类方法(如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 不需要在链接时访问目标文件来进行实例调用,但确实需要在链接时访问类调用。有人可以指出我的文件来确认这一点吗?
这个问题类似于以下问题: