Xcode using schemes to determine dev/staging/production server URLs

Viewed 7654

I wish to use Xcode's schemes to determine what server to run my app against. I have an app that fetches its information from a server. Like most people I have a development server, a staging server and a production server.

I wish to create a scheme for each of these where Xcode will inject the correct URL. Do I duplicate the run scheme and add environmental variables? Is this the best way to do things, I don't particularly wish to have #ifdef's in my server class and setting it in code each time I change server. Can anyone point me in the right direction please?

FYI: I'm using Xcode 5.0.2 iOS7 SDK.

[EDIT] Everyone gave some great suggestions but I feel @redent84 answer best suits my needs. Though I found it interesting that none actually suggested using different schemes. [/EDIT]

3 Answers
Related