Xcode Groups&文件:如何将项目A中的文件复制到项目B而不会发疯?

问题描述:

由于某种原因,XcodeGroups& Files中的表示与我所有真实项目文件所在的文件夹中的文件层次结构不匹配。出于某种原因,我无法复制整个组甚至单个文件并将其放入另一个项目中。所以我在Groups& Files中有一个很好的图像层次结构,但所有这些有序的图像都是无序的,只是在我的文件系统中只有一个巨大的文件夹。非常可怕;)

For some reason, the representation in Xcode "Groups & Files" does not match the file hierarchy in the folder where all my real project files are. And for some reason, I can't copy a entire group or even single file and put that into another project. So I have a nice hierarchy of images within "Groups & Files", but all thos ordered images are unordered like a big mess in just one giant folder full of stuff on my file system. Really horrible ;)

所以现在我想把我的所有图标放到另一个项目中,但我不能复制组img> gui> icons。我必须从我的文件系统中选择每个图标图像,其中图标与其他几百个图像和文件混合。

So now I wanted to put all my icons into another project, but I cant just copy the Group "img > gui > icons". I have to pick every single icon image from my file system, where icons are mixed up with a few hundred other images and files.

是否有一些隐藏的选项我可以激活这样Xcode将设法在文件系统上的项目文件夹中重现Groups& Files的层次结构?或者我怎么能复制这些文件?

Is there some hidden option I can activate so that Xcode will manage to reproduce the hierarchy of "Groups & Files" inside my project folder on the file system? Or how else could I copy those files?

将一个层次结构完整地从一个项目移植到另一个项目是不可能的。一些建议的方法:

It's not really possible to transplant a Groups hierarchy intact from one project to another. Some suggested approaches:


  • 如果你想要带来的文件是项目的绝大部分,只需克隆项目并删除所有的项目。不是你要复制的文件。

  • 如果是少数组中的很多文件,那么在新项目中设置组,并从中拖放复制文件旧项目组进入新项目组

  • 编写AppleScript以使用递归下降算法移动层次结构

  • ◆◆打开两个项目。将pbxproj文件作为文本文件,并小心地将文件引用和组引用从一个复制到另一个。

  • If the files you want to bring across are the vast majority of the project, just clone the project and delete everything that's not the files you want to copy.
  • If it's a lot of files in a small number of groups, then set up the groups in the new project, and drag-copy the files from the old project groups into the new project groups
  • Write an AppleScript to move the hierarchy across with a recursive-descent algorithm
  • ◆◆ Open both project.pbxproj files as text files, and carefully copy the File References and Group References from one to another.