title: Unit Testing in With A Static Library
body: <p>I have an XCode workspace with a user interface project (UI) and a core logic project (Core). I want OCUnit unit tests in the UI project, so I have added a new target for testing, as is commonly done.</p>
  
  <p>I am able to run tests just fine until I put in import statements for classes in the main UI target which in turn reference the Core project.</p>
  
  <p>The error I get is "Lexical or Preprocessor Issue 'xxx.h' file not found". I do not get this message when I build the main UI target directly.</p>
  
  <p>It's as if the main UI target knows about Core when it is built, but when it is referenced from the test target it seems to know nothing about Core.</p>
  
  <p>I took the step of adding a reference to the core project using the "Link Binaries with Libraries" The item in the list remains red. A clue? Maybe, but the red reference in the Link list doesn't keep the UI target from building and using core classes. I also made the main target a dependency of the test target.</p>