I have a UIWebView built into my view controller as follows:

I have access to my _graphTotal ( _graphTotal ) and I can successfully load the contents of test.html in it using this:
[_graphTotal loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[[NSBundle mainBundle] pathForResource:@"test" ofType:@"html"]isDirectory:NO]]];
Now I am trying to pass data to a web view and no luck. I added <UIWebViewDelegate> and here is what I am trying:
NSString *userName = [_graphTotal stringByEvaluatingJavaScriptFromString:@"testFunction()"]; NSLog(@"Web response: %@",userName);
And here is the content of test.html in my project:
<html> <head></head> <body> Testing... <script type="text/javascript"> function testFunction() { alert("made it!"); return "hi!"; } </script> </body> </html>
I see "Testing ..." in my web browser, but I do not see a warning and do not return "hello!". line.
Any idea what I'm doing wrong?
Clifton labrum
source share