Reputation: 23
So, I am kind of a newbie in iOS / Objective-C programming.
My company has a working app made by someone else and I am trying to get an understanding for everything in order to do some minor adjustments.
Right now, I have a problem I can't get around.
Here is the deal:
I have a NavigationController and from my rootView I push other ViewControllers when someone selects rows in a tableView. Every step has its own ViewController.
tableView 1 -> tableView 2 -> tableView 3 -> tableView 4
In ViewController 3 I added a UIToolBar in XIB with 3 buttons. That is the only place where the user can do actions. I added properties for the toolbar and the 3 buttons plus the 3 actions for pushing the buttons.
When the user selects a row in tableView 3, the navigationController pushes the ViewController with tableView 4.
The ViewController of tableView 4 has no UIToolbar in XIB, but the Toolbar from tableView 3 is shown.
How can I hide the UIToolBar again?
I tried:
[self.navigationController setToolbarHidden:YES];
I think I am missing some kind of basic knowledge :)
I hope that at least some of you can give me a hint how to look at my problem the right way to get the answer.
Thanks
Matthew
Edit:
I missed something reaaaaalllly important!
tableView 3 didSelectRowAtIndexPath is pushing the ViewController for tableView 3 AGAIN with other datasource.
So it is basically:
tableView 1 -> tableView 2 -> tableView 3 (Item) -> tableView 3 (Subitem)
Upvotes: 0
Views: 173
Reputation: 561
Put above statement in viewWillAppear method of ViewController of tableView 4
-(void)viewWillAppear:(id)animated
{
[self.navigationController setToolbarHidden:YES];
}
Upvotes: 1