I currently have a UIWebView that is displayed within a modal view. It is basically a detail view that provides a view of a page when the user clicks a link. When the view
In my case I needed to clear the web view from its contents instantaneously and be able to start loading something else right away. Neither loading an empty document HTML string nor clearing the page with JavaScript resulted in desired effect. Instead I used:
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"about:blank"]]];
[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://stackoverflow.com"]]];
And this cleared the view to the default background and initiated next page's loading as expected.
I hope this helps someone else as well.