NOTE: \"Use GHUnit\" is not an acceptable answer to this question. I know most think GHUnit is better than the Xcode4 OCUnit, but that\'s not what I\'m asking about. I\'ll evalu
When I get linker errors running unit tests, two things fix the problem for me. The first solution is to set the Test After Build build setting to YES and choose Product > Build For > Build For Testing to run the tests. This solution is the easier one to implement.
The second solution is to add the application's implementation files to the unit test target. Open the file inspector by choosing View > Utilities > File Inspector. Select an implementation file in the project navigator. Select the checkbox next to the unit test target in the file inspector.
For iPhone applications running in the simulator, make sure the Test Host build setting is blank. The simulator does not support application-hosted unit tests.