tags:

views:

32

answers:

1

I have an iphone app that I want to be able to configure to configure for different serves that I have in a multistage deployment

Currently I have them in three .plist templates (containing urls, API keys, etc.) that I switch between, but that is getting annoying and since XCode has the different build configurations, I was wondering if there was a way I could hook into that so I can just one-click "debug" "release" "staging" to switch between the profiles

Thanks!

+1  A: 

There may be a more elegant way to do this, but this is what I'd do:

#ifdef DEBUG
    //Load debug plist
#else
#ifdef STAGING
    //Load staging plist
#else
    //Load release plist
#endif //staging
#endif //debug

Add 'DEBUG=1' to the preprocessor symbol definitions in the Debug configuration and 'STAGING=1' to the Staging configuration

kubi