I have a UITableView that displays the names of people in any department. When you then select a person in TableView, it loads a detailed page with labels with all their contact information; then below it loads its website in a smaller UIWebView.
If you select a person, view their information, return, then select another person in the same department, UIWebView will not reload the newly selected website, it remains on the site of the person who was first selected.
I tried all night for this to work; I am sure this is something simple.
I tried setting webView to nil and freeing it in viewDidDisappear and viewWillDisappear (those that get called when you return to the list of people after viewing).
I have this configured as a UINavigationController.
Labels for the selected person indicate all updates for the selected person, but UIWebView just does not want to restart. Any help is appreciated!
EDIT Sorry I forgot to add the code, it was too late when I published this LOL. But here, where all my shortcuts and things are updated (I took these lines to clear them here).
-(void)viewWillAppear:(BOOL)animated { NSLog(@"willAppear"); [[self navigationItem] setTitle:[selectedPerson professorLName]]; url = [[NSURL alloc] initWithString:[selectedPerson departmentWebsite]]; NSLog(@"%@", url); req = [[NSURLRequest alloc] initWithURL:url]; [webView loadRequest:req]; webView.scalesPageToFit = YES; } - (void)viewWillDisappear:(BOOL)animated { NSLog(@"willDis"); [super viewWillDisappear:animated]; [webView release]; webView = nil; url = nil; } - (void)viewDidDisappear:(BOOL)animated { NSLog(@"didDisappear"); [super viewDidDisappear:animated]; [webView release]; webView = nil; url = nil; }
source share