How to stop huge Prefix.pch.gch file from copying to application package

For some reason, Xcode decided to start copying the huge Prefix.pch.gch file to the application’s resources folder when it was created. This file is not in the build phase of the Bundle copy resources, and I cannot find other project settings that should tell Xcode about this. Has anyone seen this before and knew what was going on?

+4
source share
5 answers

Today I had a problem with the same symptoms, it turned out that this was due to the fact that one of my objective C files was included in the phase of the Bundle Resources copy files of the target (due to a drag accident or the xcodeproj file becomes damaged in some moment). GCC then helped to include precompiled headers for the prefix header in the target, since there is a dependency on the source file.

Running Get Info on the source file in question did not display all the tabs in the file information dialog, even if the file type was set to sourcecode.c.objc.

Removing the file from the project and re-adding it fixed the problem.

+3
source

You can try "Show package contents" in the xcode project file in finder, and then open the project.pbxproj file in a text editor (not in xcode).

If you are looking for ".pch" and / or ".gch", you might notice something.

+1
source

Are there any steps to copying files?

Is the Prefix.pch.gch file in the project group tree? The easiest way to check this is to select a project object and then search for "gch" in the "Details" view.

0
source

I solved this problem differently. Firstly, I like to use the prefix file, so I have many inclusions for standard logging, colors, etc.

For each inclusion in the prefix file, make sure that each of them is processed only once! This can be done by setting:

#ifndef __<Classname>__ #define __<Classname>__ < your original header file here > #endif 
0
source

If you select the "Project" item in the "Project" menu, and then in the form of the "Details" tab, and then select the project in the "Groups and Files" list on the left, do the files indicated in the right view have a checkmark? and what is checked? If so, check it out.

-2
source

Source: https://habr.com/ru/post/1310622/


All Articles