简体   繁体   中英

iOS: Linker errors with OCUnit integration

I am adding OCUnit test case target to my existing iOS project. I have followed the tutorials from below links and done it. It created a new target for "MyAppTests" and .m, .h files. I added SenTestingKit.framework also.

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/

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

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!

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

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM