title: iPhone SDK: UIWebView
body: <p>I'm working on an app that uses a UIWebView to display its help files. The webView lives in it's own view, DocViewController...when its called the </p>
  
  <pre><code>- (void)viewDidLoad {
  </code></pre>
  
  <p>method uses</p>
  
  <pre><code>[webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:   [[NSBundle mainBundle] pathForResource:docPage ofType:@"html"]isDirectory:NO]]];
  </code></pre>
  
  <p>to load the proper doc page.  However, once the first page is loaded, the view becomes static and new pages aren't loaded when the docPage changes and the view is toggled. Is there a way to clear the webView so new pages load when requested?  </p>
  
  <p>Edit:<br>
  The first answer is confusing to me. As is the routine below works. It's just that it only works <em>once</em>. After the view is loaded the first time it does not change when this view is toggled on again and the requested html page is different. The view always displays the first html page requested and will not load new requests.</p>
  
  <pre><code> - (void)viewDidLoad {
  
       docPage = [NSString stringWithFormat: @"%d", hexpage];
  
       [webView loadRequest:[NSURLRequest requestWithURL:[NSURL fileURLWithPath:[NSBundle mainBundle] pathForResource:docPage ofType:@"html"]isDirectory:NO]]];
  
   }
  </code></pre>