title: Load resources from relative path using local html in uiwebview
body: <p>I have a very simple iOS app with a uiwebview loading a very simple test page (test.html):</p>
  
  <pre><code>&lt;html&gt;
  &lt;body&gt;
  &lt;img src="img/myimage.png" /&gt;
  &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>I load this test.html file into my web view:</p>
  
  <pre><code>NSURL *url = [[NSBundle mainBundle] URLForResource:@"test" withExtension:@"html"];
  NSString *html = [NSString stringWithContentsOfURL:url encoding:NSUTF8StringEncoding error:nil];
  NSURL *baseUrl = [NSURL fileURLWithPath:[[NSBundle mainBundle] bundlePath]];
  [webView loadHTMLString:html baseURL:baseUrl];
  </code></pre>
  
  <p>This works fine if I reference the image without the relative path and put the referenced image in the root path under Targets -> Copy Bundle Resources within XCode, however I can't get it to work with the relative path as shown in my html file.  There must be a way to do this, I have lots of images, css, javascript files that I want to load into the webview and I would like not to have to have everything in the root and have to change all the references in my web app.</p>