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

  • SEARCH
  • Home
  • 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 6965479
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T16:04:01+00:00 2026-05-27T16:04:01+00:00

Here is my problem. I have a view based application. I added a NavigationController

  • 0

Here is my problem.
I have a view based application.
I added a NavigationController to the AppDelegate as follows.

UINavigationController *nvc = [[UINavigationController alloc] initWithRootViewController:_viewController];    
navigationController = [nvc retain];
[nvc retain];     
[self.window addSubview:navigationController.view];

This code I got from internet. I don’t know if it is correct.

In all the viewControllers I am doing the following to push a new view.

UIViewController *newViewController = [[NewViewController alloc] init];
[self.navigationController pushViewController:newViewController animated:TRUE];
  1. I don’t know why self.navigationController does not return nil in the pushed views. Is it using AppDelegate navigation controller somehow?

  2. If I want to reuse some view controllers. I mean not alloc init every time that I want to call the view controller. How can I do that? Store a reference in the AppDelegate? Any other solution?

  3. I have a complicated navigation. i.e. A, B, C are view controllers. A calls B. B calls C. C calls A. If I keep calling I am creating a new view controller each time. How can I reuse those view controllers (or pop and release the view from the stack when calling a new one)?

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-05-27T16:04:01+00:00Added an answer on May 27, 2026 at 4:04 pm

    1) navigationController is a property of UIViewController. If the view controller is part of a navigation controller hierarchy then it will be set.

    2) You’ll have to manage this yourself. Storing a reference in the object that pushes that view controller would be the usual way to achieve this. So if A pushes B then A stores a reference to B, etc.

    3) There’s no way to get UINavigationController to do this for you. From what you’re trying to do I assume you’re coming from an Android background? Android has specific ways to do just that, but in iOS you’d have to code it yourself. You could do this by looking at UINavigationControllerDelegate and its navigationController:didShowViewController:animated: method. You could see when a view controller is pushed and if it’s already in the stack then update the navigation stack (i.e. the viewControllers property of UINavigationController) to remove it from where it was. But that might get quite confusing for the user.

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

Sidebar

Related Questions

I have a problem here. My Zend_Forms do not render in view script. Via
I have encountered a problem of placing data into the Table View. Here is
I have created a window-based application and my problem is I am unable to
I have a view based application which has some textboxes that I'm trying to
Here's my problem: I have an application which uses sql server express 2005, and
Here is the problem I have: I have a lot (tens of thousands) of
Here's my problem - I have some code like this: <mx:Canvas width=300 height=300> <mx:Button
Here's my problem: I have a virtual method defined in a .h file that
Here is the problem: we have lots of Javascripts and lots of CSS files,
Here's my problem: I have to call a web service with a secure header

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.