I had this same issue when creating a new test case in XCode. However, this was due to stupidity of me selecting the wrong target when creating the test case.
Using “File New…”, the test case was being included and compiled with the target application settings instead of test case’s target. Checking the Build Phases tab and looking in the “Compile Sources” disclosure revealed my particular issue.