I'm doing a navigation based application. Let me explain a little bit about the application. At the program load table view will show 3 options like:
- Hotel
- Restaurants
- Cafe
If a user selects any of the above options, it will navigate to another table view and show sub options. And it'll continue up-to 6 to 7 levels.
So I in the didSelectRowAtIndexPath:
of the tableView's class (Sales) I created it's own object and using [self.navigationController pushViewController:myViewController animated:YES];
I'm creating another view and binds data from the database. It's working fine for me, ut the issue is. I'm not getting the 'back' button that is automaticaly displays on the navigation bar.
my implementation is like this
@implementation Sales
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
Sales *myViewController = [[Sales alloc] initWithNibName:@"Sales"];
[self.navigationController pushViewController:myViewController animated:YES];
//Do other stuffs here
}
@end
Like this I'm displaying the all levels. But when I navigated inside of any option I didn't get a back button. (Usually if I navigates to Hotel it will show a detailView and shows a back button on the navigation bar, but in this case this is not happening). I think the issue is with creating objects of the same class and displaying it, but I can't create such a number of classes and views (about 43 levels total). How can I resolve this issue (How can I show back button on the navigation bar) ? Is my method is good one or Is there any alternative solutions for this issue? Thanks in advance.