You have 2 options:
Paste HTML directly as follows:
UIWebView *wv = [[UIWebView alloc] init]; [wv loadHTMLString:@"<html><body>YOUR-TEXT-HERE</body></html>" baseURL:nil];
Download the html file that exists in your project:
UIWebView *wv = [[UIWebView alloc] init]; NSURL *htmlFile = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"test" ofType:@"html"] isDirectory:NO]; [wv loadRequest:[NSURLRequest requestWithURL:htmlFile]];
If you want your example to work, replace the resulting code as follows:
[super viewDidLoad]; NSURL *htmlFile = [NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"index" ofType:@"html"]]; [_viewWeb loadRequest:[NSURLRequest requestWithURL:htmlFile]];
source share