I first duplicated my project before I renamed it. After the rename i'm getting
Lexical or Preprocessor Issue <XCTest/XCTest.h> not found.
The error directs me to the myapptests.m file which calls to
#import <XCTest/XCTest.h>
Also the next line
@interface SpyShotTests : XCTestCase
The "XCTestCase" is not hi-lighted in purple.
Any tutorial i've seen has directed me to the Framework Search Paths in Build Settings - but the framework search path is exactly the same as the initial file and that file builds with no issues.
I came across something similar and I'm wondering if my solution might be helpful.
You may want to check that the file which is throwing the error is included in the appropriate Target Source's "Compile Sources". It's possible your file might not have been included. In my case it had been included with the project target and not with the test target. Since XCTest is only accessible with the Test Target, it wouldn't compile for me generating the error "XCTest/XCTest.h file not found".
Project Targets >> Build Phases >> Compile Sources:
You can fix this by either manually adding it to the "Compile Sources" as per the above image or you can remove the file from the project and re-add it, making sure to select the Test Target when you re-add:
In case it helps anyone else I came across this after moving a test case file (in the file system) and then re-adding it to my test project (right click, 'Add Files to "Project"...'). It turns out I wasn't adding the file to the Test target - I was just adding it to the Project Target.