【问题标题】:Linker errors when building OCUnit application test target for iOS为 iOS 构建 OCUnit 应用程序测试目标时出现链接器错误
【发布时间】:2011-08-26 20:24:52
【问题描述】:

我的 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 不需要在链接时访问目标文件来进行实例调用,但确实需要在链接时访问类调用。有人可以指点我的文件来确认这一点吗?

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

Imported files not recognized in OCUnit

OCUnit will not allow me to use my own data types

【问题讨论】:

    标签: objective-c ios ocunit


    【解决方案1】:

    【讨论】:

    • 我会调查此事。听起来很有道理。
    猜你喜欢
    • 2011-08-12
    • 1970-01-01
    • 1970-01-01
    • 2013-07-17
    • 2017-10-13
    • 1970-01-01
    • 1970-01-01
    • 2013-07-09
    • 1970-01-01
    相关资源
    最近更新 更多