Is there a place (or flag) in Xcode for files that you don't want to compile? There are some classes that are/may become part of a project but currently won't compile. The main project doesn't link to them but Xcode still tries to compile them. Is there a way to prevent blocking the rest of project from compiling until these new Classes are "ready"?
4 Answers
Note that for every source file you can specify which target(s) it belongs to - look at the inspector window for a file (Get Info) and then hit the Targets tab. If you deselect a target for a given source file then it won't be compiled as part of the build process for that target.
[This amounts to much the same thing as what Eimantas has said in his answer - it's just a different way of looking at it.]

- 208,748
- 37
- 389
- 560
-
1Yes, basically the same as what Eimantas suggested. Wish I could split the "prize" over both answers but I can't. So, I'll choose this approach because it's more from the perspective of the file/class itself than from the Target. And Eimantas already has plenty of upvotes... – Meltemi Apr 01 '10 at 18:32
-
Heh, i got more points from upvotes than Paul from upvotes and accepted answer .) +1 from me too! – Eimantas Apr 04 '10 at 07:21
-
@Eimentas: thanks for the +1 - I already gave you a +1 earlier so I guess we're even. ;-) – Paul R Apr 04 '10 at 07:24
Look for unneeded files in "Compile sources" in Target -> {AppName} branch. Remove them from there and they won't be compiled on next build (make sure to Clean before you Build again)

- 48,927
- 17
- 132
- 168
In Xcode 8.3.3, in the utilities window, click on File Inspector tab at the top of the window. Uncheck the file in the Target Membership area of the File Inspector. Please see image below.

- 381
- 2
- 6
You can use preprocessor statements:
#ifndef HIDE_<insert name here>
CODE
#endif
And then use:
#define HIDE_<insert name here>
above the aforementioned code in the files you don't want to compile.

- 3,375
- 1
- 22
- 27