views:

40

answers:

0

Hey Guys,

So I have a lot of configuration settings in the plist, but do not like to invoke the infoDictionary all the time when accessing the objects. I was thinking to load all the configuration into a settings class and make that accessible throughout the application.

So in the plist, say I have a key "font" and a string "Arial".

I am thinking to create another class SettingsVar, subclass of NSObject. In there, for each item in the info.plist that I need, I would create a static var (this has to be a class variable, declared in .m file?). So I'd have a static NSString* font, and when I do call an init method, I would just read all of the class variables

(e.g. NSString* font = [[[NSBundle mainBundle] infoDictionary] objectForKey:@"font"];

And I would just import the GlobalVar header file to all UI controllers that would need all of these variables, and they can be changed at runtime, so the user can change the font, for example.

Does this seem like a good implementation, or is there another, easier way?

Thanks, I just started iphone development two weeks ago and could use the help.