Possible Duplicate:
Where to store global constants in an iOS application?
I'd like to store config variables in a central place. The variables do not change on runtime. They should be accessible from any class in the project.
My current approach is to have a GlobalSettings.h file with the config variables defined like this
#define kCacheAge 10.0 //Max. Cache Age in Seconds
#define kNavigationTitleTint colorWithRed:0.443 green:0.471 blue:0.502 alpha:1.0
#define kNavigationTitleFont boldSystemFontOfSize:20.0
... and include their name wherever I need it.
Downsides:
- I need to include this GlobalSettings.h file in every Class manually
- I cannot insert these constants as a part of Strings (the string handling seems to be stronger than the replacement action)
Is there a better way to do this, maybe avoiding the mentioned downsides? Any best-practices for storing config variables?