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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T01:34:30+00:00 2026-05-24T01:34:30+00:00

I have to pop to HomeScreenViewController from current view controller after clicking on custom

  • 0

I have to pop to HomeScreenViewController from current view controller after clicking on custom back button, which is added on main window as a light box. I used following code :

HomeScreenViewController *homeController = [[HomeScreenViewController alloc] 
initWithNibName:@"HomeScreenViewController" bundle:nil];
    [self.navigationController popToViewController:homeController animated:YES];
    [homeController release];

I got crashing with exception : Tried to pop to a view controller that doesn't exist.

How can it be implemented? What changes are required for implementing it?

  • 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-24T01:34:31+00:00Added an answer on May 24, 2026 at 1:34 am

    Clearly you are creating a new instance of HomeScreenViewController which doesn’t exist on the navigation stack. You will have to get the existing instance and use it as an argument for popToViewController:animated: method. You can do it by getting the view controller from the viewControllers array which is a property on UINavigationController. They are indexed in order so if the view controller is at index 1 then get the view controller using

    UIViewController * viewController = [self.navigationController.viewControllers objectAtIndex:1];
    [self.navigationController popToViewController:viewController animated:YES];
    

    If you want to go back to root view controller, use popToRootViewControllerAnimated: instead.

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

Sidebar

Related Questions

I have a little python script that pulls emails from a POP mail address
I have a pop up window which lists images using a form and radio
In a WPF application, I have buttons which pop up instances of windows. I
I have a pop-up window from an exiting application that I want to trap
I have a pop-up CustomControl which I use in a large-scale web application. The
Lets say I have a view, myView, a view controller, myViewController, and some sort
I have a pop up button that is triggered by deleting an object. How
I have a pop up date picker which insert a selected date into a
i have an pop.html which contains a <div> . can i use jquery to
I have a pop up which contains an ASP.NET form, click the link Request

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.