In my development I wish to hit a development URL when im testing but when the app is run on my iPhone, I want it to run on production URL. How do I get about setting this in Xcode?
Almost seems like I need to be able to set environmental variables (which in this case are different URLs).
Where do I set these up? Please hand hold me on the answer as I am fairly new
Thanks
There are lots of ways to do this. My preferred method is to create a file called Constants.h that looks like this:
Then, I just include it in my *-Prefix.pch file like this:
In your build settings, set DEVELOPMENT, or STAGING, or PRODUCTION = 1.
Now you can access things like ROOT_URL anywhere in your project.
Good luck!