I wonder if, when building an iPhone app for the Simulator, there are special DEFINEs added that allow me to conditionally compile for this case?
If not, I’ll have to add my own targets for this case, but I’d rather have an automatic way of detection.
Alternatively, is there a dynamic way to know when my code runs on the Simulator, I mean something that’s documented? I’ve been searching the docs for a while now but had no luck yet.
For compile-time check you need TARGET_IPHONE_SIMULATOR defined in TargetConditionals.h
For run-time check you can use for example
-modelmethod in UIDevice. For iPhone simulator it returnsiPhone Simulatorstring (not sure about iPad simulator though)