Xcode项目文件未出现在Project Navigator中

时间:2023-01-13 18:06:06

Strange problem here...my project's Swift files, Main.Storyboard, additional images, delegate, etc. files are all missing from Xcodes Project Navigator.

这里有一个奇怪的问题...我的项目的Swift文件,Main.Storyboard,附加图像,委托等文件都在Xcodes Project Navigator中丢失。

What is really strange is that the project builds fine and I can also select them from the top of the main editor window even though they are not displayed on the left in the Project Navigator.

真正奇怪的是项目构建正常,我也可以从主编辑器窗口的顶部选择它们,即使它们没有显示在Project Navigator的左侧。

When I open my project, the files appear for about 1/2 a second, and then the list is condensed to the blue target file at the top and about 7 images. (I cannot post a picture because my reputation is not high enough.)

当我打开我的项目时,文件显示大约1/2秒,然后列表被压缩到顶部的蓝色目标文件和大约7个图像。 (我不能发布图片,因为我的声誉不够高。)

I've quit and reopened Xcode and also performed a few restarts, but I still can't select them...even though they're apparently there! Any ideas?

我已经退出并重新打开Xcode并执行了一些重启,但我仍然无法选择它们......即使它们显然在那里!有任何想法吗?

3 个解决方案

#1


39  

May be you need check the Project Navigator's bottom, there is a search bar.

可能是您需要检查Project Navigator的底部,有一个搜索栏。

If the search bar had some keywords, the Project Navigator would only show the files which file's name contain the keyword(s), and you can't clear the keyword by only reopen Xcode.

如果搜索栏中有一些关键字,Project Navigator将只显示文件名包含关键字的文件,并且只能通过重新打开Xcode来清除关键字。

When you open Xcode, Xcode will initial the search bar with nothing and you can see the complete files, after initial had done, Xcode will load last close time's state for the search bar and filter files, so that's why When I open my project, the files appear for about 1/2 a second.

当你打开Xcode时,Xcode将在没有任何内容的情况下初始化搜索栏,你可以看到完整的文件,在初始完成后,Xcode将加​​载搜索栏和过滤器文件的最后关闭时间状态,这就是为什么当我打开我的项目时,文件出现约1/2秒。

#2


28  

For me the issue was different. My search bar was empty but I had mistakenly selected the clock icon in the search bar at the bottom of the navigator.

对我来说,问题是不同的。我的搜索栏是空的,但我错误地选择了导航器底部搜索栏中的时钟图标。

Unselected it looks like this

未选中它看起来像这样

Xcode项目文件未出现在Project Navigator中

Selected it look like this

选择它看起来像这样

Xcode项目文件未出现在Project Navigator中

The clock icon filters the files for files that have been recently used and therefore, hides a number of your files.

时钟图标会过滤最近使用过的文件的文件,因此会隐藏一些文件。

#3


0  

This is caused by conflicts project.pbxproj file inside your projects, to get out of this error just follow bellow steps.

这是由项目内部的project.pbxproj文件冲突引起的,为了摆脱这个错误,只需遵循以下步骤即可。

  1. Find the backup of your project, if you don't have any backup copy "project.pbxproj" file from another (any) project. its located inside "projectName.xcodeproj" just copy it by clicking show package contents.
  2. 如果您没有来自其他(任何)项目的任何备份副本“project.pbxproj”文件,请查找项目的备份。它位于“projectName.xcodeproj”内,只需单击show package contents即可复制它。
  3. Replace this file in your current project.
  4. 在当前项目中替换此文件。

Thats it!

而已!

Happy Coding

快乐的编码

#1


39  

May be you need check the Project Navigator's bottom, there is a search bar.

可能是您需要检查Project Navigator的底部,有一个搜索栏。

If the search bar had some keywords, the Project Navigator would only show the files which file's name contain the keyword(s), and you can't clear the keyword by only reopen Xcode.

如果搜索栏中有一些关键字,Project Navigator将只显示文件名包含关键字的文件,并且只能通过重新打开Xcode来清除关键字。

When you open Xcode, Xcode will initial the search bar with nothing and you can see the complete files, after initial had done, Xcode will load last close time's state for the search bar and filter files, so that's why When I open my project, the files appear for about 1/2 a second.

当你打开Xcode时,Xcode将在没有任何内容的情况下初始化搜索栏,你可以看到完整的文件,在初始完成后,Xcode将加​​载搜索栏和过滤器文件的最后关闭时间状态,这就是为什么当我打开我的项目时,文件出现约1/2秒。

#2


28  

For me the issue was different. My search bar was empty but I had mistakenly selected the clock icon in the search bar at the bottom of the navigator.

对我来说,问题是不同的。我的搜索栏是空的,但我错误地选择了导航器底部搜索栏中的时钟图标。

Unselected it looks like this

未选中它看起来像这样

Xcode项目文件未出现在Project Navigator中

Selected it look like this

选择它看起来像这样

Xcode项目文件未出现在Project Navigator中

The clock icon filters the files for files that have been recently used and therefore, hides a number of your files.

时钟图标会过滤最近使用过的文件的文件,因此会隐藏一些文件。

#3


0  

This is caused by conflicts project.pbxproj file inside your projects, to get out of this error just follow bellow steps.

这是由项目内部的project.pbxproj文件冲突引起的,为了摆脱这个错误,只需遵循以下步骤即可。

  1. Find the backup of your project, if you don't have any backup copy "project.pbxproj" file from another (any) project. its located inside "projectName.xcodeproj" just copy it by clicking show package contents.
  2. 如果您没有来自其他(任何)项目的任何备份副本“project.pbxproj”文件,请查找项目的备份。它位于“projectName.xcodeproj”内,只需单击show package contents即可复制它。
  3. Replace this file in your current project.
  4. 在当前项目中替换此文件。

Thats it!

而已!

Happy Coding

快乐的编码