18

From Xcode project right click and Add File to "projectName" there I created a NewFolder "ABCD" name and added to same "ABCD" empty folder to the project its in Blue colour, I expected its in Yellow Color, What the files which I added inside Blue Colour folder files are not compiling in X-Code all files which added in Blue Colour folder say file is not found after compiling the code.

Is there any why that default, I added folder are link related to the project?

Its very strange for me this issue, Your feedback is very helpful.

Sulthan
  • 128,090
  • 22
  • 218
  • 270
KkMIW
  • 1,092
  • 1
  • 17
  • 27

1 Answers1

52

If you simply drag drop a file and choose Create Folder reference, it will add as a blue folder. Please make sure you select "Create groups" from the dialogue and make sure you have selected all the targets in the "Add To Targets" section.

Like this

enter image description here

It will be added as yellow enter image description here

Group-> With groups, Xcode stores in the project a reference to each individual file. This can lead to problems:

Folder references-> Folder references are simpler. You can spot a folder reference because it shows up in blue instead of yellow.

Tyler A.
  • 3,048
  • 1
  • 23
  • 27
Manish Pathak
  • 3,224
  • 1
  • 18
  • 22
  • 3
    There is no need to select all targets - only relevant ones should be selected. – Losiowaty Jun 27 '17 at 08:21
  • That's why I said, project target. Let's say you have two targets one for dev and other for production you should select both of them. – Manish Pathak Jun 27 '17 at 08:23
  • Ah, you are right. My mind made a shortcut when skimming through your answer. – Losiowaty Jun 27 '17 at 08:26
  • 1
    The contents of a "Folder Reference" does not compile per the original question. Xcode 9.2 ... Add Files ... all it does is take me to the file system... there is no dialog as you displayed above, and added folders show up in blue and their content does not get compiled. So while they may be "simpler," they don't get correctly added to the project build process. – Logicsaurus Rex Dec 27 '18 at 23:36
  • Is there a way to get a blue reference folder to compile? If not, what is their purpose? – sambecker Jan 12 '19 at 23:32