Files in Xcode not working (names in red)

寵の児 提交于 2019-12-09 07:36:23

If files marked in red, they are "not found" by Xcode.

You either moved or deleted them within File Finder, outside Xcode. Delete the red marked files within XCode, then add them again to XCode.

This will solve your problem.

I solved this problem as follows: click on the Group name in which file names are showing in red colour in the Xcode navigation area (Navigator) on the left side. In the Utility area on the right side in Xcode open up File Inspector tab. There is a Field named Full Path:, click on the arrow placed last to the path. You will have popup window showing your project path. Change The Group Folder in which you already moved your files from Finder.

In my case after moving the projects to a new folder and fixing each file location, the project compiles properly but the files names were still in red.

The problem was that the files were grouped in groups. The group was the cause of the red names of the files. So I added new groups, with identical names to the old ones (Xcode allows to do it since it does not know were is the old group), moved the files from each group to it's new group and deleted the old groups.

Now all the red names are gone.

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!