0
votes

How to add a web view to the root view controller in the split view based application. The following is the code which i am using,

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

but in the output its not producing any output.

2

2 Answers

0
votes

As it looks like an local html, you can also try doing it with loadHTMLString method like

[webView loadHTMLString:htmlString baseURL:nil];

load htmlString with the html content of your bundle html file.

0
votes

You may also create a request using:

NSURL *url = [NSURL URLWithString:@"link"];
NSURLRequest *req = [NSURLRequest requestWithURL:url];
[[viewController webView] loadRequest:req];

Or something along those lines. You're going to have to tweak things a bit to have everything communicate properly. Just make sure you declare your webView in the App Delegate...