Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p><strong>FURTHER EDITED JUNE 2017:</strong> Xcode 9 does this automatically, no special effort required. This answer and <a href="https://stackoverflow.com/a/27024809/184060">Brandon's</a> only apply to Xcode 8 and earlier.</p> <p><strong>EDITED DECEMBER 2016:</strong> Brandon's answer below is a better solution now. Back when this answer was created in 2010 this was the only option I could find. I now suggest <a href="https://stackoverflow.com/a/27024809/184060">Brandon's answer</a>, below.</p> <hr> <p>It turns out that moving files into real folders is certainly possible, though not as simple as it should be. </p> <p>I got the basic information from a question here, <a href="https://stackoverflow.com/questions/1799944/xcode-organising-files-and-folders-core-data-model-objects-iphone"><strong>Xcode organising files and folders (core data model objects - iPhone)</strong></a>, but learned important things along the way.</p> <h2>The Process</h2> <p>Moving the files is a two-step process with multiple sub-steps:</p> <ol> <li><p><strong>Tell Xcode where you want the files to be</strong>:</p> <ul> <li>Right/Control-click on the file or file group that you'd like to move and choose <strong>Get Info</strong> from the contextual menu that appears. The <strong>Group Info</strong> or <strong>File Info</strong> window appears.<br> <br /> </li> <li>Click the <strong>Choose</strong> button on the far right side of the window in the <strong>Path</strong> area. A dialog box appears.<br> <br /> </li> <li>Navigate to the folder you want the files to be moved to. Create a <strong>New Folder</strong> if needed. Click the <strong>Choose</strong> button in the bottom-right corner of the dialog box, then close the <strong>Group Info/File Info</strong> window.<br> <br /> </li> <li>The names of the file/files in the group will turn red to indicate that Xcode can't find them in the place you specified.<br> <br /> </li> </ul></li> <li><p><strong>Move the actual files</strong></p> <ul> <li>In the Finder (or Git) move the files you selected in step 1 into the actual folders you want them in.<br> <br /> </li> <li>Switch back to Xcode. The files/groups should all have turned black again. If any are still red then you've missed moving something to the right folder.</li> </ul></li> </ol> <h2>Tips</h2> <p>I learned a couple of important things while adjusting the ~300 files in this project:</p> <ul> <li>Some files refuse to move this way; that is, when you navigate to the new destination the <strong>Choose</strong> button is disabled, as is the <strong>New Folder</strong> button. The solution, though I don't know why it makes a difference, is to first use Xcode to put those files in a Group (right/control-click the files and choose <strong>Group</strong>, and give the group a name) and then move the group to the new location. After you're actually moved the files in the Finder you can remove them from the group (by dragging them into the new parent group/folder and deleting the group).<br> <br /> </li> <li>Stop and build every few minutes, after completing step 2 for a number of files. The build will tell you if you've screwed anything up so far, making it easier to go back and fix it before you've done too much damage.<br> <br /> </li> <li>If the files won't move to where you want them to &mdash; I had a devil of a time moving some files that had been created early-on in the Classes folder &mdash; you can simply drag them out of their old place in the finder to someplace handy like the desktop, delete references to them in Xcode, and then re-import them via the right/control-click <strong>Add Existing Files</strong> option.<br> <br /> </li> <li>If in the past you've used Xcode to delete references to files without also moving them to the trash in this project, you'll find files that don't have to be moved but at just sitting there. Be careful that you don't do what I did, confusing the names of a current group of files I was moving and the older, no-longer-linked files, insisting that Xcode import them because you thought it was being dense.</li> </ul> <p>Hope this helps some future person. I'm surprised that it was as difficult and occasionally tricky as it was.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload