title: iOS: Force UIWebView to reload / prevent caching
body: <p>I have an iPhone app that shows a website. This website changes it's content from time to time but my app doesn't reload it every time it is opened. I tried to prevent the caching of the site, but without success.</p>
  
  <p>This is my init method:</p>
  
  <pre><code>- (id)init:(NSString *)url withTitle:(NSString *)theTitle withPageName:(NSString *)pageName {
      self = [super init];
      if(self) {
          NSLog(@"websiteviewcontroller init");
          self.title = theTitle;
          self.url = url;
          self.pageName = pageName;
  
          CGRect frame = [[UIScreen mainScreen] applicationFrame];
          webView = [[UIWebView alloc] initWithFrame:frame];
  
          NSURL *theURL = [NSURL URLWithString:url];
          [webView loadRequest:[NSURLRequest requestWithURL:theURL]]; 
  
          // support zooming
          webView.scalesPageToFit = YES;
  
                  //[[NSURLCache sharedURLCache] removeAllCachedResponses];
                  [webView reload];
  
      }
      return self;
  }
  </code></pre>
  
  <p>This is my viewWillAppear-Method:</p>
  
  <pre><code>- (void)viewWillAppear:(BOOL)animated {
  
      CGRect frame = [[UIScreen mainScreen] applicationFrame];
      webView = [[UIWebView alloc] initWithFrame:frame];
  
      NSURL *theURL = [NSURL URLWithString:url];
      [webView loadRequest:[NSURLRequest requestWithURL:theURL]]; 
  
      [webView reload];
  
      // support zooming
      webView.scalesPageToFit = YES;
  }
  </code></pre>
  
  <p>Please help me to solve this problem. All answers are much appreciated.</p>