如何在 Xcode 中刷新 Project Navigator 内容?

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/12454430/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-09-09 04:32:44  来源:igfitidea点击:

How to refresh Project Navigator content in Xcode?

xcode

提问by Alexandru R

I'm not able to refresh file list in Project Navigator. There is no refresh button, and I don't think restarting Xcode should be the solution.

我无法在 Project Navigator 中刷新文件列表。没有刷新按钮,我认为重新启动 Xcode 不是解决方案。

How do you see files that you add externally? I'm on Mac.

您如何查看外部添加的文件?我在 Mac 上。

回答by bames53

How do you see files that you add externally?

您如何查看外部添加的文件?

Files cannot be added externally. Dumping a source file into the project directory does not add it to the project. To add a file you must add it to the project from within Xcode.

不能从外部添加文件。将源文件转储到项目目录中不会将其添加到项目中。要添加文件,您必须从 Xcode 中将其添加到项目中。

If you have a bunch of files that you need to add then in the Add File dialog you can just select all the files you want at once and add them, without having to repeatedly open the Add File dialog. Just use control clicking to select multiple files.

如果您有一堆文件需要添加,则在“添加文件”对话框中,您只需一次选择所需的所有文件并添加它们,而无需重复打开“添加文件”对话框。只需使用控制单击来选择多个文件。

回答by justin

Close and reopen the project, if necessary.

如有必要,关闭并重新打开项目。



This may be required if you are using folder references (as one example). In that case, touching the directory might work to refresh what Xcode displays.

如果您使用文件夹引用(作为一个示例),则可能需要这样做。在这种情况下,touching 目录可能会刷新 Xcode 显示的内容。

回答by Tim

For a single file, you can open the external file in Xcode and cmd+sto save it, it will be refreshed in Xcode.

对于单个文件,可以在 Xcode 中打开外部文件并cmd+s保存它,它会在 Xcode 中刷新。

Also, for the quick way you can just chose the external folder in Xcode and cmd+s, it will refresh all your external file in this folder.

此外,为了快速,您可以在 Xcode 和cmd+ 中选择外部文件夹s,它将刷新此文件夹中的所有外部文件。

回答by achmad syarippudin

You can just press "Command + B", for refresh your project in xcode

您只需按“Command + B”,即可在 xcode 中刷新您的项目