问题
Xcode run into compilation error while running the code.
Unfortunatetly I was not able to find a solution online.
These steps that I have commenced:
=> git merge branch-name => can't find the files => git checkout branch-name file-name => files were physically found => xcode can't see it
??? 
回答1:
You have to add them to your project at File -> Add Files To "Your Project"
btw: Your project folder in Xcode does not necessarily reflect your actual folder structure you see in finder.
Edit:
if you want it to be like that (Xcode folders are the same as the existing folders in your harddrive) I found a nice tool which does that for you: https://github.com/venmo/synx
also, when creating new folders/groups in Xcode, you have to use the New Group with Folder option to also create a folder for that group on your harddrive.
回答2:
Tested in xcode 11
You have to add them to your project by pressing right-click on the app folder Add files to "app"... select all the missing and NEEDED files, click on create groups option and press finish.
回答3:
Maybe when you add those files to the project you did not linked them to your Target.
When you add file to your project make sure it's link to your target.
check the following:
- select the file (.m file) that causing this error.
- select the file inspector
- make sure that your Target is selected in the check box.
- NOTE: you can't link .h files to the target, only .m and .swift
回答4:
Looks like whenever I added my files to git, I never actually added MyProject.xcodeproj/project.pbxproj file. This file has all the references for new files. Make sure you add that file to your git.
来源:https://stackoverflow.com/questions/17610469/why-xcode-cant-see-these-files-however-they-physically-exist