I am using a UINavigationController to push a UIViewController onto the stack, then when the user selects a row in the table view I allocate a new version of the view controller and push it onto the stack this works fine but then when I start pressing the back button the NSMutableArray that I am using to store the information seems to be keeping the value from the view controller that was just poped from the stack.
Here is the method that is pushing the new onto the stack:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
[tableView deselectRowAtIndexPath:indexPath animated:YES];
if (indexPath.section == 1) {
if (hasLoadedResponses && [responses count] == 0) {
return;
}
VideoDetailViewController_iPhone *nextView = [[VideoDetailViewController_iPhone alloc] initWithNibName:@"VideoDetailViewController_iPhone" bundle:nil withVideoArray:[responses objectAtIndex:indexPath.row]];
nextView.navController = navController;
[navController pushViewController:nextView animated:YES];
[nextView release];
}
}
I'm sure there is something stupid I am missing, but can't seem to find it right now.
VideoDetailViewController_iPhoneinteract with theNSMutableArray? That's probably where your problem is. - yuji