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

The Archive Base Latest Questions

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

I have a view controller and I want to implement a navigation controller inside

  • 0

I have a view controller and I want to implement a navigation controller inside it, but when I implemented it through Interface Builder or programmatically it doesn’t work.

Most of it I implemented through Interface Builder, but here is the code I implemented in the AppDelegate, and which I am trying to implement in my view controller.

UINavigationController *navController = [[UINavigationController alloc] initWithRootViewController:viewController];
[window addSubview:navController.view];

I know I can’t implement “window” in a view controller so I tried this in my view controller:

[self.view addSubview:navController];

But it still doesn’t work.

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

    In the app delegate’s applicationDidFinishLaunching you have to add this code.

    viewController=[[myViewController alloc]init];
    navigationController=[[UINavigationController alloc]initWithRootViewController:viewController];
    [self.window addSubview:navigationController.view];
    

    where viewController is the object of the myViewController class to which u need to add the navigation controller. It s declared in the header file of appDelegate.Similarly the navigationController is also declared in tat. Hope this helps.

    New code:

    AppSettings *settings = [[AppSettings alloc] init];
    UINavigationController *navCont = [[UINavigationController alloc] initWithRootViewController:settings];
    navCont.navigationBar.barStyle = UIBarStyleBlackTranslucent;
    [self.navigationController presentModalViewController:navCont animated:YES];
    [settings release];
    [navCont release];
    
    • 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 which also has a table view. I want to
I have a Table View Controller with cells. I want to update the text
I have a few methods inside my view controller that load up for future
I'm trying to implement a navigation controller with some hierarchical views. I want to
I would like to have a view (Hierarchy structure) under Navigation Controller (the top
I have an app where I want to have one background view (view controller
I have two view controller classes in my application delegate. I can change from
Lets say I have a view, myView, a view controller, myViewController, and some sort
In a word, how? I have a view controller that creates a few custom
A simple question: I have a Model-View-Controller setup, with Models accessing a SQL database.

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.