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 ma开发者_如何学JAVAinBundle]pathForResource:@"rightview"ofType:@"html"]isDirectory:NO]]];
but in the output its not producing any output.
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.
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...
精彩评论