Import XCTest into an existing project

I added a new target as the Cocoa Touch Unit Testing Bundle, named the directory "MyAppTests", and the actual structure is not active - it is highlighted in red

enter image description here

When I add the framework using 'link binary with libraries' in the 'build phase' tab method, the new Framework is added, instead of updating the one that was created with the goal added.

enter image description here

When I go to run the code, I then encounter all the troubles, from bug fixing to other frameworks that are not recognized.

How can I activate the XCTest.framework that was generated when I added the target? Please help, thanks!

+7
ios unit-testing xcode
Oct 07 '13 at
source share
1 answer

XCTest.framework is the package that Xcode uses to enable

#import <XCTest/XCTest.h> 

To add test cases to an existing project, select the target, right-click> file> new> object of class test c. Then in the build steps you can add XCTest.Framework. Before creating a test case, make sure that you select the "Add to target" checkbox.

+9
07 Oct '13 at 16:41
source share



All Articles