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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T22:31:06+00:00 2026-05-16T22:31:06+00:00

i have this at my appdelegate: for 1st app: – (void)applicationDidFinishLaunching:(UIApplication *)application { [window

  • 0

i have this at my appdelegate:

for 1st app:

   - (void)applicationDidFinishLaunching:(UIApplication *)application {    

   [window addSubview:rootController.view];
   [window makeKeyAndVisible];
  }

this will display a navigation and tabar display for my app.

ok no problem here.

next i have this from another app:

   - (void) applicationDidFinishLaunching:(UIApplication *)application {    
      _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

     MainViewController *_mainViewController = [[MainViewController alloc] init];
      UINavigationController *_navigationController = [[UINavigationController alloc] initWithRootViewController:_mainViewController];

     [_window addSubview:_navigationController.view];
       [_window makeKeyAndVisible];
       }

which also works fine.

now, how can i include all this function into my 1st app? i would like to use it for one of my tab options.

i’ve tried:

 - (void)applicationDidFinishLaunching:(UIApplication *)application {    

    Tab4 *_mainViewController = [[Tab4 alloc] init];
    UINavigationController *_navigationController = [[UINavigationController alloc] initWithRootViewController:_mainViewController];

    [window addSubview:_navigationController.view];
[window addSubview:rootController.view];
[window makeKeyAndVisible];

}

sort of combining the two. there is no compiling error but the program is not working.
i got it wrong somewhere and stuck. is it possible to have 2 subivew?
any help is greatly appreciated.
thks.

hi,

i’ve embedded the a nav controller in my tab bar.
but doing this does it “replace” the code completely?

      _window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];

     MainViewController *_mainViewController = [[MainViewController alloc] init];
      UINavigationController *_navigationController = [[UINavigationController alloc] initWithRootViewController:_mainViewController];

     [_window addSubview:_navigationController.view];
       [_window makeKeyAndVisible];

tab view gets load up fine but it is unable to receive a notification.
thks

  • 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-16T22:31:07+00:00Added an answer on May 16, 2026 at 10:31 pm

    Your TabBarController should be the only subview to the window, and a window should have only 1 subview. Include the navigation controller inside one of the tabs. A TBC cannot be used inside of a navigationController. Here is a simple tutorial showing you how to add a navigation controller to a tab. Also, you should read the Apple Documentation on Tab Bars.

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

Sidebar

Related Questions

I have this code in my applicationDidFinishLaunching in the AppDelegate: - (void)applicationDidFinishLaunching:(UIApplication *)application {
Hello, I have this code in my AppDelegate : [window addSubview:viewController.view]; [window makeKeyAndVisible]; return
I have this code in my AppDelegate - (void)applicationDidBecomeActive:(UIApplication *)application { NSLog(@+applicationDidBecomeActive); NSNotificationCenter *center
I have this method in App Delegate that makes a window and content view
I have this appdelegate.h #import <UIKit/UIKit.h> @interface appDelegate : NSObject <UIApplicationDelegate> { UIWindow *window;
I currently have this method: -(void)seperateGuides { DLog(GetGuideListCount: %i, [[appDelegate getGuideList] count]); columnOneArray =
I have this in my view controller: [[[UIApplication sharedApplication] delegate] sendMessageAsSingleObject:[sender currentTitle]]; Which gives
I have a static variable on appDelegate declared like this: appdelegate.h file: +(NSMutableArray*)allBanco; +(void)setAllBanco:(NSMutableArray*)value;
In my iOS5 app for iPhone I have something like this AppDelegate ivar ViewController1
In my appDelegate.m I have this code, but the UILabel is not displaying, but

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.