Answer the question
In order to leave comments, you need to log in
How to switch between controllers in code?
Good day, sorry for such a banal question, but I'm confused
In general, let's say I have 2 controllers, one of them is the root for the navigator controller, how do we plant when the button is pressed, switch to the 2nd controller?
I do it like in the lessons, but the program flies or something else
(I added a header)
SecondCont * sec=[[SecondContalloc alloc] initWithNibName:@"???" bundle:nil];
[self.navigationController pushViewController:sec animated:YES];
Answer the question
In order to leave comments, you need to log in
Don't forget to put the correct identifier in IB
YourViewController *vc = [self.storyboard instantiateViewControllerWithIdentifier:@"YourViewControllerIdentifier"];
[self.navigationController pushViewController:vc animated:YES];
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question