Here is the code:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
DrinkDetailViewController *detailViewController = [[DrinkDetailViewController alloc] initWithNibName:@"DrinkDetailViewController" bundle:nil];
[self.navigationController pushViewController:detailViewController animated:YES];
[self.navigationController popToRootViewControllerAnimated:YES];
[DrinkDetailViewController release];
}
I want to have a back bar to go to my root view from the detail view. How do I do it?
There’s 2 things that look a little weird here… hopefully fixing em will make the back btn show up:
The
UINavigationControllershould take care of the back button for you as far as I know. If not, I would check to see that everything is wired up correctly in your xib (if you have one). Good Luck!