问题
My XCode 8.2.1 doesn't let me add a folder reference.
What I have tried:
I make a right click on the folder called "Unity", then I click on "Add files to Project...", under options I check "Create folder references".
My folder is added as a red file instead of a blue folder how it would be normally.
I tried changing the 'type' of the file to 'folder' under "Identity and Type", then it becomes a light blue folder, but there are no files inside and I can't seem to put them inside in any way, and the name is still red.
Then I manually choose location and the red is gone however there is still nothing in the folder.
Someone might know what is happening?
回答1:
Once again proved the bugginess of XCode, so what solved the above described problem was one (or more) of these things:
- restart Mac
- open project
- clean, clean build folder, delete derived data
- try to add wanted folder again
- close the project
- reopen project and the wanted folder is drawn and painted as it should be, also containing all the files necessary
After a brief happiness, when I tried to build again I got a pbxcp error - "Data" - No such file or directory. Then I did:
- Open project settings
- Choose Build phases
- Remove the wanted folder from Copy Bundle Resources
- Click on the wanted folder in the project navigator
- Under "Identity and type" choose "Absolute path"
- Click on the little folder icon and choose the location
- Go back to Copy Bundle Resources and add again your wanted folder
- Compile
Good luck!
来源:https://stackoverflow.com/questions/41699971/xcode-8-2-1-cannot-add-folder-reference