Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Xcode File management. What is best practice?

Tags:

xcode

I've been using Xcode for a while now. One thing that always bugs me is the way it handles files. I like to have my files all in nested folders rather than one big physical folder, but when you create a group in Xcode by default it does not create a folder just a virtual folder within the project.

I can see that virtual folders are great for linking code in arbitrary places into your project but once you get beyond a few classes I find the one big folder approach really painful. And then if you try to fix it later it takes ages and is easy to break your build.

Is it possible to change this behaviour so that by default it creates a physical folder? Or am I doing it wrong and trying to cling to some other way of working? How do other people work with files in Xcode?

like image 356
Ian1971 Avatar asked Jun 09 '10 13:06

Ian1971


People also ask

Where are Xcode files stored?

It should by located in: ~/Library/Developer/Xcode/DerivedData . Show activity on this post. You can configure the output directory using the CONFIGURATION_BUILD_DIR environment variable.

How do I group files in Xcode?

Edit related files together using tabbed windows in Xcode. To open a new window tab with the same configuration as your current window, press Command-T. To open existing files in tabs within a single window, select one or more files, and choose File > Open in New Window. Then choose Window > Merge All Windows.

What is project Navigator in Xcode?

The Project navigator displays your project's files and lets you open, add, delete, and rearrange those files. To open the Project navigator, at the top of your project window's navigator area, click the icon that resembles a file folder.


1 Answers

1) Remove all the files from the project. Select All and press Delete, and click the Delete File References button, not the Also Move to Trash one. 2) Go to the Finder or Terminal and rearrange your files in folders to your heart's content. 3) Select all the top-level files and folders and drag them back into your project. When given the choice, choose Create Groups for Added Folders.

You'll now have a group hierarchy that follows the directory hierarchy on disk.

You'll need to make sure all the proper files get back into their correct build phases and targets. It's best to do this one target at a time in a multi-target project.

like image 139
cdespinosa Avatar answered Nov 15 '22 06:11

cdespinosa