title: How can my iPhone Objective-C code get notified of Javascript errors in a UIWebView?
body: <p>I need to have my iPhone Objective-C code catch Javascript errors in a UIWebView.  That includes uncaught exceptions, syntax errors when loading files, undefined variable references, etc.</p>
  
  <p>This is for a development environment, so it doesn't need to be SDK-kosher.  In fact, it only really needs to work on the simulator.</p>
  
  <p>I've already found used some of the hidden WebKit tricks to e.g. expose Obj-C objects to JS and to intercept alert popups, but this one is still eluding me.</p>
  
  <p>[NOTE: after posting this I did find one way using a debugging delegate.  Is there a way with lower overhead, using the error console / web inspector?]</p>