-(bool) webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType{
if (navigationType == UIWebViewNavigationTypeLinkClicked) {
NSURL *url = request.URL;
BrowserLinker *linker= [[BrowserLinker alloc]initWithNibName:@"BLinker" bundle:nil];
[self.navigationController pushViewController:linker animated:YES];
return NO;
}
else {
return YES;
}
}
I have a UIWebView declared in the BrowserLinker class, and that method also declared. When a link is clicked in UIWebView, it has to open in a new ViewController. Can someone please tell me what is wrong with code? Btw code is adapted from SO answer.
ERROR: WebKit discarded an uncaught exception in the webView:decidePolicyForNewWindowAction:request:newFrameName:decisionListener: delegate: Could not load NIB in bundle: ‘NSBundle (loaded)’ with name ‘BLinker’
Nib filenames generally share the same basename as their accompanying view controller filenames. Here you’ve got the view controller called
BrowserLinkerand the nib calledBLinker. Are you sure your nib isn’t calledBrowserLinker?