which depends on your lol programming style.
you can, as you said, create a singleton that will read your xml and store everything.
you can create a static hash in your class. Thus, when you create a new object, you will have access to static information from this class.
You can pass information from class to class as parameters.
if you want us to tell you which one will be the best, it will be difficult without knowing the architecture of your program.
for example, you might have a view controller that handles any changes, and then just store data at that level to pass it on when switching views.
you may have static views in which you could directly set all the values ββwhen they open.
you may have views related to each other that cause each other without any controller to handle the switch, in which case you may prefer to be able to collect the necessary information from a singleton or static method ...
Jason rogers
source share