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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T13:06:13+00:00 2026-06-02T13:06:13+00:00

I have created 6 view controllers in the following way: Truck_Tracker_AppAppDelegate *delegate = (Truck_Tracker_AppAppDelegate

  • 0

I have created 6 view controllers in the following way:

Truck_Tracker_AppAppDelegate *delegate = (Truck_Tracker_AppAppDelegate *)UIApplication.sharedApplication.delegate;
UIViewController *viewController1 = [[TrucksViewController alloc] initWithNibName:@"TrucksView" bundle:nil];
UIViewController *viewController2 = [[MapViewController alloc] initWithNibName:@"MapView" bundle:nil];
UIViewController *viewController3 = [[BlockPartyViewController alloc] initWithNibName:@"BlockPartyView" bundle:nil];
UIViewController *viewController4 = [[FavoritesViewController alloc] initWithNibName:@"FavoritesView" bundle:nil];
UIViewController *viewController5 = [[UserSettingsViewController alloc] initWithNibName:@"UserSettingsView" bundle:nil];
UIViewController *viewController6 = [[TOSettingsViewController alloc] initWithNibName:@"TOSettingsView" bundle:nil];

I need viewController1, 3, and 4 to be wrapped in a navigation controller programmatically. I found this on Apple Developer’s website:

- (void)applicationDidFinishLaunching:(UIApplication *)application
{
UIViewController *myViewController = [[MyViewController alloc] init];
navigationController = [[UINavigationController alloc]
                            initWithRootViewController:myViewController];

window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
window.rootViewController = navigationController;
[window makeKeyAndVisible];
}

But I need to do it where I’ve created the viewControllers. Any ideas?

  • 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-02T13:06:14+00:00Added an answer on June 2, 2026 at 1:06 pm

    Well, there’s some things you have to understand about UINavigationController first. By using UINavigationController * navigationController = [[UINavigationController alloc]initWithRootViewController:myViewController];, you are actually creating the navigation controller for the class myViewController, which automatically grants it a default UIToolBar, and a default UINavigationBar. And because UINavigationController is a subclass of UIViewController, it can be freely used in it’s place in any function that takes said class as an argument.

    I assume you’ll be wanting to use this in a UITabbar, so create an individual UINavigationController instance for each view controller, gather them into an NSArray* and set them equal to the ‘viewControllers’ property on your UITabbar.

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

Sidebar

Related Questions

I have created segues in the following way: view controller VC1 is the root
If i have a controller action Create that returns a view with the following
I have created model, controller and view with rails scaffold generator: rails g scaffold
I have created an MVC 3 view, just by adding a controller and scaffold
I have created View A and View B. My window has View A displayed
I have a very basic iphone app where the following steps occur. App Delegate
Here is my scenario: I have the following menu created from a viewModel <ul>
Assume the following scenario. You have three controllers: getFirstData getSecondData useFirstData The workflow of
I have a MasterViewController.h.m.xib (UIViewController) that is opening a TestDummy.h.m.xib (UIViewController) in the following
In a word, how? I have a view controller that creates a few custom

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.