18

I'm looking to create a precompiled header file, to avoid having to include the same debug and tracking libraries in every header in the project.

I've created a file called -Prefix.pch:

#ifdef __OBJC__
#import "Blah.h"
#import "Blarg.h"
#endif

and added it to the project. Is there anything more I'm supposed to do, or should things just work now (assuming I do a project clean and recompile)?

blueberryfields
  • 45,910
  • 28
  • 89
  • 168

2 Answers2

38

Set the target's build settings as follows:

GCC_PRECOMPILE_PREFIX_HEADER=YES
GCC_PREFIX_HEADER="Prefix.pch"

Note that you can plop these keys in the Build Settings search field, if you prefer to use Xcode's UI for your build settings.

justin
  • 104,054
  • 14
  • 179
  • 226
0

I got this error in my flutter app when using the library flutter_inappwebview and tried to set deployment version of ios in Runner > General to 12.0.

I set it back to 11.4 and it built with no problems.

MattyO
  • 115
  • 2
  • 9