[英]iOS: Linker errors with OCUnit integration
I am adding OCUnit test case target to my existing iOS project. 我正在将OCUnit测试用例目标添加到我现有的iOS项目中。 I have followed the tutorials from below links and done it.
我已经按照下面链接中的教程进行了操作。 It created a new target for "MyAppTests" and .m, .h files.
它为“ MyAppTests”和.m,.h文件创建了一个新目标。 I added SenTestingKit.framework also.
我还添加了SenTestingKit.framework。
http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/UnitTesting/02-Setting_Up_Unit_Tests_in_a_Project/setting_up.html#//apple_ref/doc/uid/TP40002143-CH3-SW1 http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/UnitTesting/02-Setting_Up_Unit_Tests_in_a_Project/setting_up.html#//apple_ref/doc/uid/TP40002143-CH3-SW1
http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/ http://twobitlabs.com/2011/06/adding-ocunit-to-an-existing-ios-project-with-xcode-4/
But when i click on "Product" menu "Test" option, it gives always the following linker errors. 但是,当我单击“产品”菜单的“测试”选项时,它始终会出现以下链接器错误。
I tried solving errors by following these links and the solution they have provided, xcode 4 fails to initiate unit tests (with linker error) after I created a new scheme OCUnit testing an embedded framework 我尝试通过遵循这些链接及其提供的解决方案来解决错误, 当我创建新方案 OCUnit测试嵌入式框架 后 , xcode 4无法启动单元测试(带有链接器错误)
but, none of the solution worked for me, its still giving linker errors as it is. 但是,没有一种解决方案对我有用,它仍然给出链接器错误。 Please help on resolving these errors.
请帮助解决这些错误。
Thank you. 谢谢。
I resolved it myself, i just removed everything related to test target and created new test target and followed the same as per below Apple link, and it worked as expected! 我自己解决了这个问题,我删除了与测试目标有关的所有内容,并创建了新的测试目标,并按照与下面的Apple链接相同的方式进行操作,并且按预期运行!
http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/UnitTesting/02-Setting_Up_Unit_Tests_in_a_Project/setting_up.html#//apple_ref/doc/uid/TP40002143-CH3-SW1 http://developer.apple.com/library/ios/#documentation/DeveloperTools/Conceptual/UnitTesting/02-Setting_Up_Unit_Tests_in_a_Project/setting_up.html#//apple_ref/doc/uid/TP40002143-CH3-SW1
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.