// Are we compiling for the device, simulator, or desktop? #if TARGET_OS_IPHONE && TARGET_IPHONE_SIMULATOR #define GR_TARGET_SIMULATOR 1 #elif TARGET_OS_IPHONE && !TARGET_IPHONE_SIMULATOR #define GR_TARGET_DEVICE 1 #else #define GR_TARGET_DESKTOP 1 #endifThen I use the GR_TARGET symbols for #if'ing in platform-specific chunklets of code.