title: UIWebView baseURL and absolute path
body: <p>I have an HTML page that is constructed like this:</p>
  
  <pre><code>&lt;html&gt;
    &lt;head&gt;
      &lt;link rel="stylesheet" href="/style.css" /&gt;
    &lt;/head&gt;
    &lt;body&gt;
  
    &lt;/body&gt;
  &lt;/html&gt;
  </code></pre>
  
  <p>It is stored in my documents directory:</p>
  
  <pre><code>/Users/username/Library/Application Support/iPhone Simulator/5.1/Applications/12345-ID/Documents/mysite/index.html
  </code></pre>
  
  <p>I have also stored the style.css in the documents directory:</p>
  
  <pre><code>/Users/username/Library/Application Support/iPhone Simulator/5.1/Applications/12345-ID/Documents/mysite/style.css
  </code></pre>
  
  <p>But now, when I try to load the html into my webview using this:</p>
  
  <pre><code>NSURL *test = [NSURL URLWithString:@"file:///Users/username/Library/Application Support/iPhone%20Simulator/5.1/Applications/12345-ID/Documents/mysite/"]
  [myWebView loadHTMLString:&lt;the content retrieved from index.html&gt; baseURL:test];
  </code></pre>
  
  <p>The css is not loaded, when I intercept the request to the stylesheet with a NSURLProtocol I can see the request is wrong. It is trying to request: </p>
  
  <blockquote>
    <p>file:///style.css</p>
  </blockquote>
  
  <p>instead of the full baseURL. Now I can solve this by removing the / in front of /style.css in the html file. But is there an easy way to resolve this in native code without modifying the html?</p>