title: iOS 5 UIWebview Delegate: WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction
body: <p>I am using the delegate method <code>shouldStartLoadWithRequest</code> to catch link clicks and handle specific cases inside my app instead of allowing the <code>webView</code> to navigate to the link. In this code, I am attempting to push a new <code>ViewController</code> onto the stack. Immediately after the attempt to push the view, I get a crash with the following message in my console:</p>
  
  <pre><code>WebKit discarded an uncaught exception in the webView:decidePolicyForNavigationAction:request:frame:decisionListener: delegate:
  </code></pre>
  
  <p>My code looks like this:</p>
  
  <pre><code>-(BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType {
      if(decision logic){
          MyViewController *vc = [[MyViewController alloc] init];
          [self.navigationController pushViewController:vc animated:YES];
          [vc release];
          return NO;
      }
  
      return YES;
  }
  </code></pre>
  
  <p>I have also tried using a modal instead of pushing a new <code>viewController</code>. I get the same result. Is there any other scenarios I should be handling here?</p>
  
  <p>**Edit: Just thought of this. The view I'm trying to push contains another <code>UIWebView</code>. Should I be doing something to the first <code>webView</code> before transitioning? I just testing pushing a different view controller that doesn't contain a <code>webView</code> and it worked fine.</p>