[英]Linker errors when building OCUnit application test target for iOS
I have an Application Test included in my OCUnit target. 我的OCUnit目标中包含一个应用程序测试。 I can call instance methods on classes in my Application Host target, but I cannot call class methods.
我可以在Application Host目标中的类上调用实例方法,但不能调用类方法。 If I call a class method (like
alloc
), I get the following linker error: 如果我调用类方法(如
alloc
), 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
I assume this is because Objective-C doesn't need access to the object file at link time to make instance calls, but does need access at link time for class calls. 我认为这是因为Objective-C不需要在链接时访问目标文件即可进行实例调用,但是确实需要在链接时进行类调用。 Can someone point me to documentation to confirm this?
有人可以指出我的文档以确认这一点吗?
This question is similar to these questions: 这个问题类似于以下问题:
Imported files not recognized in OCUnit OCUnit无法识别导入的文件
OCUnit will not allow me to use my own data types OCUnit不允许我使用自己的数据类型
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.