views:

15

answers:

1

I've typically just used constants in the past for things like this, say

#define SERVICE_URL @"http://..."
//...
NSURL *url = [[NSURL alloc] initWithString:SERVICE_URL];

But is there a better way to do this without hard coding?

I would prefer not to ask something so trivial, but I tried many, many searches for things like "settings", "constants", "application settings in property lists", and so on, but they all seem to return things for other topics.

+1  A: 

Storing these in a PLIST would just be fine. I would have a service object lazy-load this only when you need it to reduce the amount of boilerplate code.

Daniel A. White
Is it possible to use the Info.plist that comes with the application template for this kind of stuff or is that a big no-no?
Shabbyrobe
@Shabbyrobe - i would avoid it. Apple may dive into that file when your app goes through approval.
Daniel A. White