James Finley
James Finley

Reputation: 485

Live and Dev URL in an iOS app

I've got a number of iOS apps that rely on an API with both a dev and live URL. What is the best way to make sure that the live URL is always used for submitted to the App Store and the dev for debugging?

Upvotes: 0

Views: 101

Answers (1)

ozz
ozz

Reputation: 1137

Your debug configuration should have a DEBUG macro which you can test for in your code to switch between URLs. See this related post.

#ifdef DEBUG
    url = [NSURL urlWithString:@"http://api.example.com"];
#endif

Upvotes: 2

Related Questions