I'm new to Objective-C. Essentially I want to store a set of Endpoint URLs as strings for use in my application, but I need a different domain based on whether the app is in DEBUG mode or not. I thought it might be useful to use a header file (Common.h for example) with some simple defines like so:

#ifdef DEBUG
    #define kAPIEndpointHost @"http://example.dev"
#else
    #define kAPIEndpointHost @"http://www.example.com"
#endif

#define kAPIEndpointLatest          [kAPIEndpointHost stringByAppendingString:@"/api/latest_content"]
#define kAPIEndpointMostPopular     [kAPIEndpointHost stringByAppendingString:@"/api/most_popular"]

Obviously this doesn't work since you can't base a constant on the value of another constant apparently.

What's the "right" way to do this? Would it make more sense just to have a proper class with class methods that return the correct endpoint values?

EDIT: Just to be clear, the "Latest" and "MostPopular" strings that are based on the host string are what I'm having the most trouble with. The compiler doesn't like the stringByAppendingString portion of the #defines.

Edit
Report