Export UIWebView Full Content to NSData? iPhone

蹲街弑〆低调 提交于 2020-01-24 09:34:25

问题


What I am trying to do is get the UIWebViews full content (Text, images, and CSS) in one litte package.
I figured NSData would be the best way to do this. Or is there another more compressed version?


回答1:


Probably late enough to respond to this, but I figured out you can get all the data from the request you made with NSCachedURLResponse as such:

NSCachedURLResponse* response = [[NSURLCache sharedURLCache] 
                                     cachedResponseForRequest:[webView request]];
NSData* data = [response data];


来源:https://stackoverflow.com/questions/13888933/export-uiwebview-full-content-to-nsdata-iphone

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!