I have an application in which i am having a table view.when pressing a button on the cell i have to go to another view controller(ie:testviewcontroller) showing what i selected in the previous one.then when pressing one button i need to go to another view controller showing the remaing values.if he select one there then i need to repeat the above process.The problem is from here also i am carrying some values to that testviewcontroller.if i pop back to my view controller how can i carry the new values.currently i am doing like this.
TestViewController *test =[[ TestViewController alloc]initWithNibName:@"TestViewController" bundle:nil];
test.itemselected=head;
test.itemid=productid;
//NSLog(@"%@",del.navigationController);
[del.navigationController pushViewController:test animated:YES];
but i know
NSArray *array = [del.navigationController viewControllers];
[array objectAtIndex:3]is my desired view controller.
can anybody know how can i avoid this pushing of same view controller again?
*EDIT*
This should be
for (TestViewController*vc in [self.navigationController viewControllers])instead of