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 7558225
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 30, 20262026-05-30T12:19:02+00:00 2026-05-30T12:19:02+00:00

I have 2 ViewControllers directly connected with a push segue. I am navigating from

  • 0

I have 2 ViewControllers directly connected with a push segue. I am navigating from first to second view controller by calling [self performSegueWithIdentifier:@"segueIdentifier" sender:sender]. On the second one I have an IBAction method that is bound to a “Done” button. Pressing that button should basically cause the first view controller to be displayed (sort of a back button). I managed to do that with:

NSArray *viewControllers = self.navigationController.viewControllers;
[self.navigationController popToViewController:[viewControllers
objectAtIndex:0] animated:YES];

I did try to achieve the same effect by using:

[self dismissViewControllerAnimated:YES completion:nil];

No matter what I tried though this didn’t do the job. I am trying to understand what exactly am I missing but I can’t figure it out. Does dismissViewControllerAnimated method work only with Modal segues ( this is the only thing that came to mind ).

Thank you

  • 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-05-30T12:19:03+00:00Added an answer on May 30, 2026 at 12:19 pm

    Yes,

    - (void)dismissViewControllerAnimated:(BOOL)flag completion:(void (^)(void))completion
    

    is when a UIViewController is displayed modally.

    - (UIViewController *)popViewControllerAnimated:(BOOL)animated
    

    should do what you are seeking.

    So basically, in your second VC:

    [self.navigationController popViewControllerAnimated:YES];
    

    You will save you a lot of trouble if you read the UIViewController and UINavigationController references. Twice 😉

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

Sidebar

Related Questions

I have a long View Controllers hierarchy; in the first View Controller I use
Using storyboards you have no easy access to the first view controller in appDelegate
I have two view controllers that allow changes to the Address Book. The first
I have several viewControllers controlled by a navigation controller. For example, viewController A and
Hey all, Here's a funny one. I have two ViewControllers: first one (fires on
From the standard view-based application, I found that the generated code did this: self.window.rootViewController
I have freshly setup app, just with a window an a root view (from
I have a question concerning Monotouch. The situation: I have 2 ViewControllers. The first
Hey. I have a Navigation-controller-based application with a number of Viewcontrollers in it which
I currently have an iPhone application with a tabbar and multiple viewcontrollers. All the

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.