It's in the SDK docs under "Compiling source code conditionally"
The relevant definitions are TARGET_OS_IPHONE (and he deprecated TARGET_IPHONE_SIMULATOR), which are defined in /usr/include/TargetConditionals.h within the iOS framework. On earlier versions of the toolchain, you had to write:
#include "TargetConditionals.h"
but this is no longer necessary on the current (xCode 6/iOS8) toolchain.
So, for example, if you want to only compile a block of code if you are building for the device, then you should do
#if !(TARGET_OS_SIMULATOR)
...
#endif
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…