OCUnit不允许我使用自己的数据类型 [英] OCUnit will not allow me to use my own data types

查看:111
本文介绍了OCUnit不允许我使用自己的数据类型的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用XCode 3.2.2对一些自定义数据类型进行单元测试.在没有这些数据类型的情况下,测试可以正常运行,但是当我使用上述数据类型时,会出现此错误:

I am using XCode 3.2.2 to unit test some custom data types. The tests run properly without those data types, but when I use said data types, I get this error:

"_ OBJC_CLASS _ $ _ classname",引用自:

"_OBJC_CLASS_$_classname", referenced from:

("classname"是类名...)

(where "classname" is the, well, class name...)

我在网上看到了暗示,它可能与链接器相关.奇怪的是,我最初遵循这些说明 http://www .mobileorchard.com/ocunit-integrated-unit-testing-in-xcode/,当我第一次尝试使用它们时,它们为我工作.现在,按照相同的说明进行操作后,我遇到了相同的错误.任何帮助将不胜感激.

I have seen hints online that it could be linker related. The strange thing is, I originally followed these instructions http://www.mobileorchard.com/ocunit-integrated-unit-testing-in-xcode/ and they worked for me the first time I tried them. Now, after following the same instructions, I'm getting the same error. Any help would be greatly appreciated.

谢谢!

-马特

推荐答案

不幸的是,您的问题模棱两可.

Unfortunately your question is pretty ambiguous.

首先,在上述教程中给出了示例示例吗?

First, is the example working given in the mentioned tutorial?

第二,我会仔细检查您的代码:

Second, I'd double check your code:

  1. 右键单击要与OCUnit一起使用的类(.m),然后单击获取信息".确保类文件中的目标指向OCUnit!这是链接的关键.

  1. Right click the class (.m) you're trying to use with OCUnit and click get info. Make sure the target in the class file is pointing to OCUnit! This is key for the linking.

您是否要在测试用例中为相关类导入.h?

Are you importing your .h for the associated class in the test case?

这篇关于OCUnit不允许我使用自己的数据类型的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆