views:

641

answers:

2

Hi, Is there any easy way to set the contents of a webview to an html string (without having to load a file)?

Thanks

+8  A: 

[[webView mainFrame] loadHTMLString:htmlString baseURL:someURL];

(Where someURL is used to resolve relative URLs in the HTML source.)

Wevah
A: 

Yes definitely calling loadHTMLString:baseURL: on the mainFrame of the webView would do it.

Randaltor