tags:

views:

127

answers:

2

I have got data from the server like 'my name is &nbsp john'. I want to display in UIWebView like 'my name is john'.
How to display it?

+1  A: 

Try the - loadHTMLString:baseURL: method.

Jacob Relkin
A: 

To load remote html file:

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL URLWithString:@"http://www.apple.com"]]];

To load local html file:

[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]isDirectory:NO]]];

To load html string:

[webView loadHTMLString:@"<img src=test.png>" baseURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]]];
Ruchir Shah