7

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

enter image description here

When I add the framework by the 'link binary with libraries' in the 'build phases' tab technique, a new Framework is added, instead of updating the one that was created with adding the target.

enter image description here

When I go to run the code, I then run in to all sorts of troubles, ranging from linking errors to other frameworks not being recognized.

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

aug2uag
  • 3,379
  • 3
  • 32
  • 53

1 Answers1

12

XCTest.framework is the bundle that Xcode uses to enable

#import <XCTest/XCTest.h>

To add test cases to an existing project select the target, right click > file > new > objective c test case class. Then in your build phases you can add the XCTest.Framework. Make sure you check the add to target boxes when creating the test case.

Taryn
  • 242,637
  • 56
  • 362
  • 405
JuJoDi
  • 14,627
  • 23
  • 80
  • 126
  • Yea, I was looking at the entire thing in the wrong way-- trying to import XCTest in to my controllers. Thanks for your help! – aug2uag Oct 10 '13 at 03:05