Is there a way to download an entire webpage for offline viewing with the iPhone SDK? I can use NSString with the contents of the URL, but that would just give me the HTML and no images. Is there any way to do it?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
The popular open source library ASIHTTPRequest
has a class that will do just this for you: download all HTML, images, and other resources associated with the page you're requesting.
It's called ASIWebPageRequest
, and you can read the documentation and download it from here: http://allseeing-i.com/ASIHTTPRequest/ASIWebPageRequest