11

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 ;)

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.

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?

Thanks
  • 40,109
  • 71
  • 208
  • 322

5 Answers5

4

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

  • 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.
cdespinosa
  • 20,661
  • 6
  • 33
  • 39
2

Steps: 1.Open up the group in Xcode 2.Select all the items you want to have in your other project 3. Right click and show in finder. 4. Copy those files to a new folder in Finder 5. Now drag and drop those files in the new folder in Finder to your newly created group folder in Xcode on the new project. 6. Accept the copy instructions on 'add file' action in Xcode

theprojectabot
  • 1,163
  • 12
  • 19
1

Copy icon files in a filtered-Finder window to an "icon-only" folder. Then import them into your new Xcode project. Repeat for any other categories.

Alex Reynolds
  • 95,983
  • 54
  • 240
  • 345
0

See my previous question here.

Also, file a bug with Apple to let them know you'd like the option to have groups represent the folder structure on disk.

Community
  • 1
  • 1
Redwood
  • 66,744
  • 41
  • 126
  • 187
-1

I am late, but this is a possibility:

Open the directory of your project using Finder. Copy whole directory (in Xcode its used as a group) into your new project. In Project navigator, right click and press "Add Files". In dialog box, select copied directory and its done.

jaafar Nasrallah
  • 561
  • 13
  • 24
Reconquistador
  • 885
  • 8
  • 28