xcode 中的文件夹结构 vs finder 中的文件夹结构

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/18661305/
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-15 03:45:39  来源:igfitidea点击:

folder structure in xcode vs folder structure in finder

iphoneiosxcode

提问by newbie

I have the following folder structure in xcode for a project.

我在 xcode 中有以下文件夹结构用于项目。

file structure in xcode

xcode中的文件结构

file structure in finder

finder中的文件结构

However, I have the above file structure in finder. Is there any way to reflect the file structure from xcode to finder ?

但是,我在finder中有上述文件结构。有没有办法将文件结构从 xcode 反映到 finder ?

回答by Cornel

I recently discovered a Command Line Toolthat will do exactly what you need. You can find it here:

我最近发现了一个命令行工具,它可以完全满足您的需求。你可以在这里找到它:

https://github.com/venmo/synx

https://github.com/venmo/synx

To install the tool, you just need to open the terminal and run the following command (use sudoto run it as a superuser and get permission):

要安装该工具,您只需要打开终端并运行以下命令(使用sudo以超级用户身份运行并获得权限):

$ sudo gem install synx

Then, just like the instructions on the GitHub webpage above indicate, use the following command to re-organize your folder structure:

然后,就像上面 GitHub 网页上的说明所示,使用以下命令重新组织您的文件夹结构:

$ synx path/to/your/project.xcodeproj

This should do it :).

这应该这样做:)。

回答by ArtFeel

You should managed it yourself in Finder, then set new Path for folders in Utility View
Xcode folder path

您应该在 Finder 中自己管理它,然后在实用程序视图中为文件夹设置新路径
Xcode 文件夹路径

回答by Steve Wilford

The "folders" in Xcode are actually groups and not necessarily linked to a folder in Finder.

Xcode 中的“文件夹”实际上是组,不一定链接到 Finder 中的文件夹。

You need to manage it yourself if you want a mirror in Xcode/Finder.

如果你想要在 Xcode/Finder 中的镜像,你需要自己管理它。

What you can do is create the folder structure you desire in Finder, then drag each folder into Xcode, this will create references to the folders as groups in Xcode and any files you create in those groups will be saved in the appropriate Finder folders.

您可以做的是在 Finder 中创建您想要的文件夹结构,然后将每个文件夹拖到 Xcode 中,这将在 Xcode 中创建对文件夹的引用作为组,并且您在这些组中创建的任何文件都将保存在相应的 Finder 文件夹中。

回答by Fahim Parkar

You cando this to some extent! There's just one extra step to do every time you create a new group (and this first time you'll have a lot of catching up to do!):

可以在某种程度上做到这一点!每次创建新组时只需执行一个额外的步骤(这是第一次您有很多事情要做!):

  • Xcode 3:Whenever you create a group in Xcode, immediately get info on it, and notice the "Path:" setting just below its name. Click "Choose..." and set it to a new folder with the same name.
  • Xcode 4:Whenever you create a group in Xcode, immediately select it and open the righthand sidebar. Notice the "Path:" setting just below its name. Click the icon next to "None" (what is that, a file in a window?) and set it to a new folder with the same name.
  • Xcode 3:每当您在 Xcode 中创建组时,立即获取有关它的信息,并注意其名称下方的“路径:”设置。单击“选择...”并将其设置为具有相同名称的新文件夹。
  • Xcode 4:每当您在 Xcode 中创建组时,立即选择它并打开右侧边栏。请注意其名称下方的“路径:”设置。单击“无”旁边的图标(那是什么,窗口中的文件?)并将其设置为具有相同名称的新文件夹。

Now, whenever you add files to the group, they'll head to the corresponding folder on disk. Woo!

现在,无论何时向组中添加文件,它们都会转到磁盘上的相应文件夹。哇!

Hence, I always create folder in Finder and then add that in Xcode.

因此,我总是在 Finder 中创建文件夹,然后在 Xcode 中添加它。

回答by Julian B.

After version 9 Xcode (haven't checked previous versions) handles this for you! As long as you create a group and you don't select "New group without folder" Xcode automagically creates a corresponding folder in your project that will be reflected in your project's file structure.

在版本 9 Xcode(尚未检查以前的版本)之后为您处理此问题!只要您创建一个组并且没有选择“没有文件夹的新组”,Xcode 就会自动在您的项目中创建一个相应的文件夹,该文件夹将反映在您项目的文件结构中。

回答by debris

Check out this article. It might help you organise your project. http://www.blackdogfoundry.com/blog/xcode4-folder-structure/

看看这篇文章。它可能会帮助您组织您的项目。 http://www.blackdogfoundry.com/blog/xcode4-folder-structure/