views:

114

answers:

1

Hi,

Could somebody suggest a technique or class library to read up on for XML Caching on the iphone?

The biggest lag in my app is the XML being downloaded from the server. If a user views a screen the xml has to be downloaded and parsed and theres a wait of a few seconds. If they leave the screen and come back to it again they have to wait all over again which is kinda crappy.

+1  A: 

if xml file was already loaded before, it was already parsed before and it is reasonable to cash already parsed data. In most cases very convenient way to store parsed xml data is key-value tree of NSDictionaries and NSArrays (xml node can be easily mapped to dictionary item where node tag is key and node content is value, if some nodes on same level have same names they mapped to array).

Using this approach you add loaded and parsed data into dictionary storage using for example url as key for all branch, then when you need data from same url again try this key before loading.

Vladimir
Thats great, thanks!
dubbeat