如何在iPhone上下载整个网页(包含图片)?
是否可以通过iPhone SDK下载整个网页以供离线查看?我可以将NSString与URL的内容一起使用,但这只会给我HTML而不提供图像.有什么办法吗?
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?
流行的开源库 ASIHTTPRequest
具有一个可以为您完成此操作的类:下载所有HTML,图像和其他资源与您请求的页面相关联.
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.
它称为 ASIWebPageRequest
,您可以阅读该文档并从此处下载: http://allseeing-i.com/ASIHTTPRequest/ASIWebPageRequest
It's called ASIWebPageRequest
, and you can read the documentation and download it from here: http://allseeing-i.com/ASIHTTPRequest/ASIWebPageRequest