I am making a Navigation based application and i’ve noticed a flaw in my app. Even though i have multiple buttons, each having its own title the button leads you to the same screen no matter what button i press. Is there a way to make sure that each button leads to a page specific to the button pressed. Such as clicking Options and it bringing you to the option menu not clicking images and it bringing you to the options menu. Any help would be appreciated Thank you.
This is my stack popping method:
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
Anotherviewcontroller *detailViewController = [[Anotherviewcontroller alloc] initWithNibName:@"Anotherviewcontroller" bundle:nil];
detailViewController.currentItem = @"Years";
[self.navigationController pushViewController:detailViewController animated:YES];
[detailViewController release];
}
You should use the indexPath to determine which button/cell has been selected and then, maybe with a switch statement if there are alot, create the the appropriate controller.