OCUnit will not allow me to use my own data types

微笑、不失礼 提交于 2019-12-11 07:15:48

问题


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", referenced from:

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

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.

Thanks!

-Matt


回答1:


Unfortunately your question is pretty ambiguous.

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

Second, I'd double check your code:

  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.

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

  3. Check the spelling of the class names?


来源:https://stackoverflow.com/questions/3153938/ocunit-will-not-allow-me-to-use-my-own-data-types

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!