开发者

iphone xml handing

开发者 https://www.devze.com 2022-12-17 00:37 出处:网络
I want my app to read a XML开发者_如何学C via internet. Also I want to keep the previously download xml so next time I may not need to download again until certain hours is passed or whatever period

I want my app to read a XML开发者_如何学C via internet.

Also I want to keep the previously download xml so next time I may not need to download again until certain hours is passed or whatever period of time according to settings.

Do you recommend me to download it first and store locally before process it? Or should I process it while downloading (with libxml2 I guess)?

What do you usually with apps using remote XML?

Targeting 3.0 devices btw.


The libxml2 library has a SAX parser that you can use to process XML as it comes in, to reduce memory usage. If you use the DOM parser, you have to store the entire document in memory, which can be an issue for iPhone and iPod Touch devices.

Take a look at Apple's XMLPerformance sample application, which demonstrates how to use the SAX parser. It's a bit more complicated than the DOM approaches, but it will be faster and use less memory.

0

精彩评论

暂无评论...
验证码 换一张
取 消