title: Difference between the UIWebView methods loadHTMLString: and loadRequest
body: <p>I have a UIWebView and I want to load an SVG image into it. The contents of the file is pure SVG i.e. <code>&lt;svg&gt;...&lt;/svg&gt;</code>. The file loads fine into normal and Mobile Safari, and also in a UIWebView using loadRequest: by doing the following:</p>
  
  <pre><code>url = [NSURL fileURLWithPath:path];
  NSURLRequest *req = [NSURLRequest requestWithURL:url];
  [webView loadRequest:req];
  </code></pre>
  
  <p>However, if I load the contents of the file into a string, and try to load the HTML string into the webview, nothing displays:</p>
  
  <pre><code>html = [NSString stringWithContentsOfFile:path
                                  encoding:NSASCIIStringEncoding
                                     error:nil];
  [webView loadHTMLString:html baseURL:nil];
  </code></pre>
  
  <p>Is there any reason between the above two techniques? Should they not give the same results? The file is pure ASCII, so I don't think there is an encoding issue.</p>
  
  <p>I guess I can get what I need done right now by using a file, but I hate to use the filesystem for non persistent data.</p>
  
  <p>Any help is greatly appreciated!!!</p>
  
  <p>Thanks,
  Ron</p>