I have an iPhone app that displays a website. This website changes content from time to time, but my application does not reload it every time it is open. I tried to prevent site caching, but to no avail.
This is my init method:
- (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]];
This is my viewWillAppear method:
- (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];
Please help me solve this problem. All answers are greatly appreciated.
source share