For example, I would like to connect to my Local DataBase if I am running from XCode (simulator or connected iPhone).
And if its not running from XCode I would connect to my Web DataBase.
I’ve seen something like:
#if TARGET_IPHONE_SIMULATOR
but I’m not sure if it would work for simulating on device.
You can determine if your app is being run under the debugger with the following code from Technical Q&A QA1361.
Tested successfully under simulator and device (iPhone 4, iOS 5.0.1).