Reputation: 21
I'm making my first iOS application to be run as an adhoc release on an iPad as part of a university project.
I need to have a configurable file somewhere within the source for setting price constants that are to be accessed from multiple subclasses of a superclass.
I'm wondering what is the best way to store these values, as there is about 150 of them, should I store them as static constants in the superclass?
Or?
Sorry, probably a very newby question, but I want to make sure I am doing it the right way
Upvotes: 2
Views: 1451
Reputation: 7603
Putting them as static constants in the superclass means you have to recompile every subclasses everytime you modify one of the values. I would use a plist or json or whatever format you like and load it from the application bundle as a static NSDictionary and then use this.
So when you modify a price, you can see it right at the next run without compiling.
Upvotes: 3