Crash when calling stringByEvaluatingJavaScriptFromString on UIWebView from button
<p>I can't find any documentation to confirm this, but it appears that you can only call the method <strong>stringByEvaluatingJavaScriptFromString</strong> in overridden methods from a UIWebView delegate. Can anyone confirm this?</p>

<p>Here's what I've tried.  I setup a button on a view, link it to a method on my viewcontroller, and make sure it works fine.  My view has a UIWebView control on it as well.  If I run the project on the simulator or on the iPhone, there are no issues.  Then I add this code to the button's method.</p>

<pre><code>[theWebView stringByEvaluatingJavaScriptFromString:@"alert('Hi there!');"];
</code></pre>

<p>When I run the project, I can click the button and see the 'Hi there' prompt and I can click OK to dismiss it.  Usually 4-5 seconds later the simulator crashes.  I occasionally see the <code>"__TERMINATING_DUE_TO_UNCAUGHT_EXCEPTION__"</code> error, but not consistently; sometimes there's no error.  It also doesn't always crash the first time.  Sometimes I go to another page, and then try it again, and it crashes.</p>

<p>If I put the same code in the webPageDidFinishLoad event it works fine.  But I'd like the code to be called when the user demands it so that event doesn't suit my needs.</p>

<p>I'm open to a workaround if you have any ideas?  Thanks in advance!</p>
