I'm developping an app that download the content of a web page on the iPhone then store it so the user would be able to access it offline.
I'm using NSURLConnection to download the page, as is the doc. But it downloads only the HTML code without extra content like images.
Even if images are not in a NSData structure, I would开发者_开发百科 like have at least some references or some delegate method call. An idea ?
You have to parse the HTML code and download all referenced files yourself (and then modify the HTML to use relative URLs if it doesn't already). This is not a trivial problem. You might want to look at the source of Unix tools like wget to get an idea of how they do it. I believe libxml2 can parse HTML so that should probably be the library you want to look into.
精彩评论