title: iPhone Dev: UIWebView baseUrl to resources in Documents folder not App bundle
body: <p>Greetings! Can anyone please kindly assist me finding a way around the following:</p>
  
  <ul>
  <li>load an html into a <em>UIWebView</em> using <em>loadHTMLString</em> and include(using <em>baseURL</em>) the resources such as the CSS, image files from folders within user's <em>Documents</em> directory - and <em>not from the MainBundle</em> of the application. </li>
  </ul>
  
  <p>I have seen tutorials on how to use baseURL to load within the application bundle/MainBundle which is straightforward but not with resources from the iPhone's Documents directories.</p>
  
  <p>The structure of my documents folder is as follows:</p>
  
  <pre><code>dirX 
  |---&gt; file.xml 
  |---&gt; dirCSS 
        |---&gt; style.css
  </code></pre>
  
  <p>I can retrieve the full path to the dir X(Users/......./dir X). However, when passing that path to the UIWebView's baseURL such that </p>
  
  <pre><code>[webView loadHTMLString:fileXMLString baseURL:pathToDirX]
  </code></pre>
  
  <p>... webView does not recognize the resources(eg style.css within dirCSS) as href'ed within the fileXMLString</p>
  
  <pre><code>&lt;link href="dirCSS/style.css" rel="stylesheet" /&gt;
  </code></pre>
  
  <p>So currently my application can successfully load the html string but does not load the stylesheet as the link to the CSS within the html string are <em>relative</em> - eg. css/style.css</p>
  
  <p>Any help is very much appreciated :)</p>