Xcode added folder in blue and related there files are not compiling
Asked Answered
R

1

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.

Reginiaregiomontanus answered 27/6, 2017 at 7:55 Comment(0)
K
53

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.

K answered 27/6, 2017 at 8:11 Comment(5)
There is no need to select all targets - only relevant ones should be selected.Finagle
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.K
Ah, you are right. My mind made a shortcut when skimming through your answer.Finagle
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.Loopy
Is there a way to get a blue reference folder to compile? If not, what is their purpose?Ked

© 2022 - 2024 — McMap. All rights reserved.