views:

516

answers:

2

I have seen many developers that add various convenience macros to the Prefix.pch of their iPhone project.

What do (or don't) you recommend adding to the iPhone Prefix.pch file? What does your Prefix.pch look like?

+2  A: 

Ewww... don't put macros in the PCH file. A PCH file is, by definition, a project specific precompiled header. It really shouldn't be used beyond the context of the project and it really shouldn't contain anything but #includes/#imports.

If you have some Macros and such that you want to share between headers, then stick 'em in a header file of their own -- Common.h or whatever -- and #include that at the beginning of the pch.

bbum
What would you include in that Common.h?
hgpc
Nothing; I'd only put the various #defines, etc... in it.
bbum
A: 

A detailed blog post on the subject:

http://www.cimgf.com/2010/05/02/my-current-prefix-pch-file/

hgpc