D
D
dimib2014-08-27 17:09:35
Apple Xcode
dimib, 2014-08-27 17:09:35

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

2 answer(s)
D
Denis Morozov, 2014-08-27
@morozovdenis

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

S
smanioso, 2014-08-27
@smanioso

www.appcoda.com/use-storyboards-to-build-navigatio... - here is a guide in English , in which the pictures show what and how to do.
PS: learn English, get used to specific terms - it will be easier to google.

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question