Question

I'm mainly from a C# background, so the workflow for iOS is a bit unusual for me, at least for now.

I was having a problem having simple segue from a main menu, to a another menu/work area, and then with the ability to go back to the main menu.

For a test, apparently I did something wrong.

I didn't write any code for this test to exhibit the problem.

What I did was just,

  • create a new single-view app
  • drag an additional view controller onto the work area
  • drag the start arrow to the new view controller (so it becomes the initial view, same thing as checking the checkbox to set it as the initial view)
  • added a button to each view controller
  • Ctrl + clicked and dragged the buttons to the opposing view
  • for the segue type, I chose "replace"
  • now the program crashes if I hit the second button to go back to the "main menu" (green view controller in this example)

So what am I doing wrong? Do I need to add some form of delegate or something?

I did find this, though it present fewer segue options in the tutorial than what I have. https://developer.apple.com/library/ios/referencelibrary/GettingStarted/RoadMapiOS/SecondTutorial.html

These are the options I have when I Ctrl + Click from a button to another view -Push -Modal -PopOver -Custom -Replace

Was it helpful?

Solution

"Have you embedded a navigation controller? You need to go to editor->embed in-> Navigation Controller. You need a navigation controller for push segue. – Kaushal Bisht"

This solved it for me. Now I'm just going to work on replacing the navigation bar with custom UI controls.

Thanks everyone! :)

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top