Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8493147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:55:36+00:00 2026-06-10T22:55:36+00:00

I have a main menu screen in my app, so that when i hit

  • 0

I have a main menu screen in my app, so that when i hit a button i push to another view controller. In one of these view controllers i use a tap gesture recognizer to to a modal view, and again to dismiss the modal view. But in this modal view I want a button {main menu} to dismiss the view controller and then dismiss a push.

How can i dismiss 2 layers of push and modal views. With a push segue do you dismiss the push view, or simply just add another push to go back. Right now i can’t dismiss the modal and push with that 1 button (thats on the modal screen).

Some advice would be helpful..

Edit:
main menu view controller ->(push segue)-> view controllerXXX
view controllerXXX ->(modal segue)-> pause controller
pause controller ->(dismiss modal segue)-> view controllerXXX
pause controller ->(???(will have to dismiss modal and pop push)???)-> main menu view controller

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:55:37+00:00Added an answer on June 10, 2026 at 10:55 pm

    You should use delegation to make a callback from the modal view controller to the parent view controller that presented it, which can then dismiss the modal and pop itself off the navigation stack.

    If you’re not familiar with the delegation pattern, see Apple’s introduction on it:

    http://developer.apple.com/library/ios/#Documentation/General/Conceptual/DevPedia-CocoaCore/Delegation.html

    You can also try this tutorial from Ray Wenderlich’s site on beginning storyboards (which also has an example in it of using delegation):

    http://www.raywenderlich.com/5138/beginning-storyboards-in-ios-5-part-1

    Edit:

    Here’s how you dismiss a modal view controler from the presenting view controller (that is, self is a view controller who presented the modal):

    [self dismissModalViewControllerAnimated:YES];
    

    Here’s how you pop a view controller off a navigation stack (where self is the view controller you want to pop):

    [self.navigationController popViewControllerAnimated:YES];
    

    See the Wenderlich tutorial (go through all of it, there’s 2 parts), it will show you how to create a protocol and call a delegate’s method.

    No, it’s not mentioned by the name “delegation” in Wenderlich’s tutorial… this is the name of the design pattern.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a main menu activity with a bunch of buttons. One button starts
I have an app that so far consists of two Activities: The Main Menu
My main view controller (representing the Main Menu in my app) has a simple
I have a main menu screen with a simple ListView that contains links to
I have a log out button on my main menu and I want it
I have an application that lives in the menubar, without a main menu or
I'm developing an app that starts with a main menu, and then continues through
I have 3 screens(xmls): screen 1 is main menu, screen 2 is main game
I have 2 classes. One will be a basic instructions screen and on that
In my app I have a navigation menu that is constant between activities. To

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.