Search code examples
iphonepathxcode4

Xcode 4 -- set the path for a group?


If I have a group of files in an Xcode 4 project, can I set a path that corresponds to the group?

Things that would be nice:

1) Move all files in the group to the directory at said path
2) Files that are added to the group automatically go to group's path. 3) Ability to define the path relative to the project, so that if the group is later moved to a different project, it gets the same relative path.


Solution

  • You can set a path for a group - highlight the group, open the utilities sidebar (right side bar), go to the first of the two tabs (File Inspector) and you'll see the "full path" for the group. That has a small arrow next to it that you click on in XCode 4 to set the path to the folder the group represents.

    In XCode 5, instead click on the small folder above and to the right of the full path (to the right of the folder name). It will bring up a dialog box to let you chose a folder to represent the group, which will then change the full path.

    It will not move existing files in there but any new files created when inside that group will show up in that location.