title: How can I add an external stylesheet to a UIWebView in Xcode?
body: <p>I have looked at various similar questions and answers and still cannot get this to work, so I'm adding my own question:</p>
  
  <p>I'm playing with UIWebView. I can create a working html page with inline CSS. I cannot figure out how to get the CSS to load if it is in a file in the app resources group.</p>
  
  <p>My code is:</p>
  
  <pre><code>NSString *path = [[NSBundle mainBundle] pathForResource:@"webViewPage2" ofType:@"html"];
      NSFileHandle *readHandle = [NSFileHandle fileHandleForReadingAtPath:path];
  
      NSString *htmlString = [[NSString alloc] initWithData: 
                                [readHandle readDataToEndOfFile] encoding:NSUTF8StringEncoding];
  
  
      webView.opaque = NO;
      webView.backgroundColor = [UIColor clearColor];
      [self.webView loadHTMLString:htmlString baseURL:nil];
      [htmlString release];
  </code></pre>
  
  <p>And my html call is this:</p>
  
  <pre><code>&lt;html&gt;
  &lt;head&gt;
  &lt;meta http-equiv="Content-Type" content="text/html; charset=utf-8"&gt;
  &lt;meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no, width=device-width"&gt;
  &lt;link rel="stylesheet" type="text/css" media="only screen and (max-device-width: 480px)" href="/greek123.css" /&gt;
  &lt;/head&gt;
  
  &lt;body style="background-color: transparent;"&gt;
  
  &lt;h2&gt;Some Title&lt;/h2&gt;
  
  
  &lt;p&gt;We can put instructions here. Such as: 
  "uh-oh You should not have pushed that button!"
  &lt;/p&gt;
  
  
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>I would appreciate any ideas or solutions. Many thanks!</p>