I have a XCode4 / iOS project with a regular target and unit test target. Everything works fine, except when I try to #import one of my classes in my test class and try to u
Another gotcha that you may hit is if your unit test is using C functions (or similar) that aren't used in the actual app.
This may be restricted to having a sub-project. In my case
My unit test used a few of the C functions that were not used anywhere else, and these were stripped from the app binary (NOT from the sub project's .a file).
The fix is to
(* don't do this to the release configs as it'll bloat the app with code that is never called).
Follow the instructions here. It doesn't require you to add any files to compile sources.
I first missed that "Symbols Hidden by Default=NO" should be for your app target, not test target.
It worked for me anyway (tm).
You should only refer to a folder inside your import if your file is inside a framework. Otherwise, once you added your file to the project, simply do #import "FRRCategory.h"
. Well, unless you did something weird with your Header Search Paths.
Make sure that the FRRCategory source file has been added to your Compile Sources for your unit test target.
Xcode 4:
Project Navigator -> "[Project Name]" -> Under Targets select your unit test target -> Build Phases -> Expand Compile Sources -> Click + at bottom of Compile sources and add the correct source file.