S R Nayak S R Nayak - 1 year ago 152
iOS Question

What is Prefix.pch file in Xcode?

So many developers are adding various convenience macros to the

. But my question is what is that

  • If i remove that
    file from my
    , then will my application run? Or will it show any error? Or will it crash during build?

  • How can i run my application without

Answer Source

Precompiled header.

What it is?

Prefix.pch is a precompiled header. Precompiled headers were invented to make compiling faster. Rather than parsing the same header files over and over, these files get parsed once, ahead of time.


In Xcode, you add imports of the header files you want in a “prefix header,” and enabling Precompile Prefix Header so they get precompiled. But the idea behind a prefix header is different from precompiling.

A prefix header is implicitly included at the start of every source file. It’s like each source file adds

#import "Prefix.pch"

at the top of the file, before anything else.

Removing it.

You can remove the precompiled header. This question has been already answered in thread I'm linking below. It contains all the information you need as well as useful comments.

Is it OK to remove Prefix.pch file from the Xcode project?

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download