Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating group in Xcode does not create folder in file system -- why?

Tags:

In Xcode IDE when I add a new group named 'Organizer' inside the default Classes group it is getting created. But when I physically see the folder in the Finder, that new group Organizer is not showing as a folder.

Actually I want to maintain the sources in a particular structure i.e, how it exists in the XCode view.

What should I do to achieve this?

like image 468
durai Avatar asked Sep 27 '11 10:09

durai


People also ask

What is create folder references in Xcode?

When you choose Create folder references the imported folder will have a classic blue folder icon in Xcode. This new folder will also be visible when you go to your projects directory, but now every new file you put there will also appear in your Xcode project. It's pretty straightforward and easy to understand.

Why are the folder icons in the Xcode navigation area referred to as groups instead of folders in Swift?

A folder in Xcode represents a folder in the file system. A group in Xcode is a "fake" folder which does NOT represent a folder in the file system. It is common to use a combination of groups and folders for a given Xcode project. Save this answer.


2 Answers

You should create all necessary folders within Finder and then add them to project (right mouse click -> Add files to XYZ project). While adding files, options should look like this:

enter image description here

UPD: Xcode 9 finally supports automatic folder creation and file reordering for groups operations!

like image 58
knuku Avatar answered Oct 07 '22 02:10

knuku


If you are adding a new group named Organizer inside the default classes group you cant see the physical folder in finder. To make physical folder you should do following steps,

1. Prepare folder structure with files in it. 2. Drag that folder into xcode i.e. project navigation pan. 3. Check the box " Copy items into destination group's folder (if needed) " 4. Select " Create groups for any added folders " 

After doing this, you will get your folder in finder. Now if you want to add new file then just

1. Right click on folder and click " Add files to < Project_Name >" 2. Select proper file 3. Check the box " Copy items into destination group's folder (if needed) " 4. Select " Create groups for any added folders " 5. Finally click to add 

You will get that folder with new file added into that.

Note : Keep in mind you get yellow colored folder.

Thank You.

like image 26
Learning Programming Avatar answered Oct 07 '22 01:10

Learning Programming