Answer the question
In order to leave comments, you need to log in
How to transition between ViewControllers?
Good day.
More recently, I decided to dive into the Obj-C language. Previously worked with C ++, but Java has always bypassed.
I have read several books including "Obj-C and Programming for Mac OS X and iOS" by Scott Knaster. To be honest, I didn’t really immerse myself in what was written, rather I tried to grab onto something known, build analogies, and so on.
Now let's move on to the question:
I create two ViewControllers in the StoryBoard. In the first one I create a button, connect it to the second one, mark it as Push.
According to my logic, this should mean that when the button is pressed, the transition from the first to the second ViewController should take place. But that doesn't happen. Xcode throws an error which mentions some Navigation Controller.
I started looking for what it is. Having climbed a bunch of forms, I somehow understood: for this to work, you need to attach the Navigation Controller to the beginning. And still an error.
I understand that my question is banal, and most likely arose from my inattention or lack of understanding, but still. Can you please tell me how to make this transition? And I would like it to be purely code, without a storyboard and NavigationController with a detailed explanation of WHAT WHERE to write.
Also, if possible, advise something on this subject from the literature translated into Russian .
Thank you.
Answer the question
In order to leave comments, you need to log in
1. read what a NavigationController is (spoiler: without it, you won’t be able to make transitions. this is not entirely true, but roughly speaking, yes, it won’t work)
2. the storyboard should start with a NavigationController and it should have an initial controller specified
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question