Navigation bar is not visible when changing manually

I have a little problem with segues in my application. I am trying to use a manual push segue. But the navigation item / controller / panel is not displayed on the target controller. When I use the button and go to the target view controller with this button, the navigation bar is displayed: /

My code is simple:

[self performSegueWithIdentifier:@"MySegue" sender:self]; 

MySegue is a push segue from the UINavigationController root view controller to the target controller.

He didn’t even work with this

 UIStoryboard *storyboard = [UIStoryboard storyboardWithName:@"Storyboard" bundle:[NSBundle mainBundle]]; UIViewController *controller = [storyboard instantiateViewControllerWithIdentifier:@"TargetViewController"]; [self.navigationController pushViewController:controller animated:YES]; 

and even if I set the top bar (navigation element) in the history help bar

thanks for any help :)

+4
source share
3 answers

Delete the segment that goes from the StaznostiViewController to the StaznostViewController. To control drag and drop from the StaznostiViewController object (in the panel below the view) to the StaznostViewController, NOT from the StaznostiViewController view or from the prototype cell of the StaznostiViewController table. Choose a Push style. Name your segue, whatever you wish.

In your code, in the target action method that you defined for your dynamic button, you call the executeSegueWithIdentifier method.

Also, make sure that in the StaznostViewController properties you have a property for the top bar set to Inferred.

+3
source

try the sender nil instead of self:

 [self performSegueWithIdentifier:@"MySegue" sender:nil]; 

hope it works

0
source

The same thing happened to me. I created a “Push” segue from the storyboard and called it code. Then he lost the navigation elements in the navigation bar. When I changed segue to "Modal", the navigation elements in the destination view appeared correctly ..

0
source

All Articles