I populate the data from my table using a loadResults routine which runs on viewDidLoad (through mHud) which works fine. However now I want to slightly alter the results from distance to accessibility (just changing the url it parses the data from)
I tried on the switch re-running my loadResults but it doesn’t seem to do anything. If i change the url it parses then swap to the same page it loads the correct new results (but screws up my navigational controller and I’m pretty sure wastes a tonne of memory doing that).
So basically I have:
-(void)loadResults {
//routine to parse XML files
[self.view reloadData];
}
- (void)viewDidLoad {
[super viewDidLoad];
self.title = @"Results";
HUD = [MBProgressHUD showHUDAddedTo:self.view animated:YES];
HUD.labelText = @"Loading";
HUD.detailsLabelText = @"updating data";
[HUD showWhileExecuting:@selector(loadResults) onTarget:self withObject:nil animated:YES];
}
I’ve just put a button on my navigational controller which swaps between them.
So i guess in essence, how do i re load my table with the new data?
Tom
If your controller is a subclass of UITableViewController you should modify the loadResults method:
So, use self.tableView instead of self.view.