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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T15:06:11+00:00 2026-06-09T15:06:11+00:00

I am launching a viewController from another view controller via the push on its

  • 0

I am launching a viewController from another view controller via the push on its table views cell. Now on the second view controller I have a whole bunch of controls mainly test fields. I would like to by using the default back button provided in the second view controller so it’ll be the title of the first view controller and keep in mind like I said default, so I don’t want to create my own button for back on the second view controller. So would like to detect if the second view controller is exiting or disappearing or will disappear and based on certain conditions stop it from going back to the original caller view controller. I originally assumed it could be done in here:

-(void) viewWillDisappear:(BOOL)animated {
    if ([self.navigationController.viewControllers indexOfObject:self]==NSNotFound) 
    {
        // So back button was pressed on the second view controller, so how do I stop it
        // here from going back to the original view controller. 
    }
}

Or how do I do it? I can’t seem to find a view controller return type BOOL method to call and stop it.

Thanks.

  • 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-09T15:06:13+00:00Added an answer on June 9, 2026 at 3:06 pm

    Note that method is called viewWillDisappear, not viewShouldDisappear, so Apple won’t let you stop the view from disappearing at that point. And from the user’s point of view, pressing the back button should indeed take them back. Instead you might consider hiding the back button under the circumstances where it’s not allowed.

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

Sidebar

Related Questions

I have a navigation controller. One of the views adds custom subviews in its
I am launching a Modal View Controller from a view controller. Everything in the
I'm launching a form from another form. I want the parent form to be
I have a root view controller that opens up a new modal view controller.
When launching a Java application in Eclipse its output goes to the console view.
I have a UINavigationController , complete with table view and associated magic. The data
I am launching many threads simultaneously, each one writing / reading data into/from a
I'm launching wkhtmltopdf from within my Java app (part of a Tomcat server, running
Apple has explained in Launching the App Store from an iPhone application how one
I'm launching my VB.NET application from the command line and then using the function

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.