title: How to call JavaScript Function in objective C
body: <p>I am new programmer to objective C. I added some html file to Objective C. In this html file contains simple javascript function. I need to call that Function through thw objective C code. I tried lot of time by using google. But I could not find real way to do it.
   Bellow Contains html File :</p>
  
  <pre><code>&lt;!DOCTYPE html&gt;
  &lt;html&gt;
      &lt;head&gt;
          &lt;script&gt;
              function myFunction()
              {
                  alert("Hello World!");
              }
              &lt;/script&gt;
      &lt;/head&gt;
  
      &lt;body&gt;
          &lt;button onclick="myFunction()"&gt;Try it&lt;/button&gt;
      &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I called this function like this : Is it correct or wrong ?? If it wrong, how to do this. Please help. </p>
  
  <pre><code>NSString *path;
  NSBundle *thisBundle = [NSBundle mainBundle];
  path = [thisBundle pathForResource:@"first" ofType:@"html"];
  NSURL *instructionsURL = [NSURL fileURLWithPath:path];
  [webView loadRequest:[NSURLRequest requestWithURL:instructionsURL]];
  
   NSString * jsCallBack = [NSString stringWithFormat:@"myFunction()"];
   [webView stringByEvaluatingJavaScriptFromString:jsCallBack];
  
  [webView stringByEvaluatingJavaScriptFromString:@"myFunction()"];
  </code></pre>