I have an application which uses a UITabBar with 5 tabs. The UITabBar has within a navigation controller for one of the tabbar items controlling a TableView for that particular view....The TableView then has a disclosure Button which moves to the detailView of selected Cell.
So : TabBarController ->5tabbarButtons one of which is NavigationController -> TableView -> DetailView.
The app gets xml data from my database/webservice and loads it all into each reusable cell to display an accurate history of events for a particular user.
The Problem is: detailView is only showing the first set of details for selected Cell:
In other words, Everything appears fine on the tableView(there are a few labels which display some basic details on each different history event for the user, However, when going on step further into detail view....The Cells in detailView display all the correct detail information for only the first cell selected. So if someone selects entry1 to see details, it displays correctly...but if they go back and then select entry2 after, entry 2 detailvew displays the details of entry1. The detailView Cells are not refreshing and allowing itself to be reused. I have looked my code over and over and can't find the solution. Please let me know if you can help. I very much appreciate it. I have included a bit of code below. Thank you.
- (NSInteger)numberOfSectionsInTableViewUITableView *)tableView {
return 1;
}
- (NSInteger)tableViewUITableView *)tableView numberOfRowsInSectionNSInteger)section {
return [appDelegate.blts count];
}
- (UITableViewCell *)tableViewUITableView *)tableView cellForRowAtIndexPathNSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
*******Some more Code*******
}
return cell;
}
- (void)tableViewUITableView *)tableView didSelectRowAtIndexPathNSIndexPath *)indexPath {
// Navigation logic -- create and push a new view controller
if(bltController == nil)
bltController = [[BltDetailViewController alloc] initWithNibName"BltDetailView" bundle:[NSBundle mainBundle]];
*******Some more Code*******
[self.navigationController pushViewController:bltController animated:YES];
}
Thank you.
So : TabBarController ->5tabbarButtons one of which is NavigationController -> TableView -> DetailView.
The app gets xml data from my database/webservice and loads it all into each reusable cell to display an accurate history of events for a particular user.
The Problem is: detailView is only showing the first set of details for selected Cell:
In other words, Everything appears fine on the tableView(there are a few labels which display some basic details on each different history event for the user, However, when going on step further into detail view....The Cells in detailView display all the correct detail information for only the first cell selected. So if someone selects entry1 to see details, it displays correctly...but if they go back and then select entry2 after, entry 2 detailvew displays the details of entry1. The detailView Cells are not refreshing and allowing itself to be reused. I have looked my code over and over and can't find the solution. Please let me know if you can help. I very much appreciate it. I have included a bit of code below. Thank you.
- (NSInteger)numberOfSectionsInTableViewUITableView *)tableView {
return 1;
}
- (NSInteger)tableViewUITableView *)tableView numberOfRowsInSectionNSInteger)section {
return [appDelegate.blts count];
}
- (UITableViewCell *)tableViewUITableView *)tableView cellForRowAtIndexPathNSIndexPath *)indexPath {
static NSString *CellIdentifier = @"Cell";
UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
cell = [[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:CellIdentifier] autorelease];
*******Some more Code*******
}
return cell;
}
- (void)tableViewUITableView *)tableView didSelectRowAtIndexPathNSIndexPath *)indexPath {
// Navigation logic -- create and push a new view controller
if(bltController == nil)
bltController = [[BltDetailViewController alloc] initWithNibName"BltDetailView" bundle:[NSBundle mainBundle]];
*******Some more Code*******
[self.navigationController pushViewController:bltController animated:YES];
}
Thank you.