views:

158

answers:

1

hi...I have read all the suggested StackOverflow posts on this question. It bothers me that Xcode will not organize my files in the finder the same way it does in the editor view...it will only do that if I copy files in from an external source and specifically tell it how I want things organized. Is there a way to make Xcode have the Finder respect the same organization as a default? I'd love to create a directory and then a file in that directory, and see the changes in both places.

I hate opening a project and seeing ALL my files in one place.

+2  A: 

If you want your Groups structure in Xcode to mirror your Directories structure in the file system (which is also the Folders structure in the Finder), you have to take the following steps when adding files that you want to go into Groups/Subdirectories:

  1. Create the folder in the Finder (or the directory from the command line)
  2. Drag that folder into your Xcode project. Import it as a Group. Make sure its reference style is Relative to Enclosing Group, and that you drop it into the Group that represents its parent directory.
  3. To add new files, select the Group and choose Add Files. The files will be stored in the directory that that Group represents, and they will be within that Group in the Xcode UI.

If your files are not yet under SCM control, one thing you can do is just delete them all from the Xcode project, rearrange them on disk however you want, then drag all the folders and files back in, making sure to not make copies, to create groups, and to set the reference style to Relative to Enclosing Group.

cdespinosa