I am creating theme for my app that is xml based and will be stored in a themes folder of my app. I need to traverse that file and apply theme i.e. set navigation bar styles, tabbar styles, fonts etc. What might be best possible solution for doing this? i have got about 7-8 viewcontrollers that needs to be applied that theme on app launch or viewdidload method. Any suggestion would be great.
I have created xml parser that converts any xml to NSMutableDictionary. Each node is identified by following class
@interface xmlObject : NSObject {
NSString *innerText;
NSMutableDictionary *children;
NSString *NodeName;
NSDictionary *attributes;
}
so xml with structure
<navigationbar>
<backgroundcolor> <!-- rgb with values between 0-1 -->
<red>0.8</red>
<green>1.0</green>
<blue>0.5</blue>
<alpha>0.8</alpha>
</backgroundcolor>
<tintcolor> <!-- rgb with values between 0-1 -->
<red>0.8</red>
<green>1.0</green>
<blue>0.5</blue>
<alpha>0.8</alpha>
</tintcolor>
<backgroundimage></backgroundimage> <!-- png 320 * 44 -->
<color> <!-- rgb with values between 0-1 -->
<red>0.8</red>
<green>1.0</green>
<blue>0.5</blue>
<alpha>0.8</alpha>
</color>
</navigationbar>
will have navigation bar as a key of NMUTAble Dictionary object returned by xmlOBject method say parsexml
and will have 4 children nodes each itself a NSMUtableDictionary. So if I want to access backgroundimage node then following code get its value
[[[[tmp objectForKey:@"navigationbar"] objectForKey:@"children"] objectForKey:@"backgroundimage"] objectForKey:@"innertext"]
// where tmp is the NSMutableDictionary returned byxml obj instance method.
What might be best possible soluion to parse xml that contains style for each screen like the one i showed for navigationbar?