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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T17:52:22+00:00 2026-05-21T17:52:22+00:00

I have created a view based application and in the appdelegate .h file I

  • 0

I have created a view based application and in the appdelegate .h file I have created UINavigationcontroller object and added it to window subview. Next in the app did finish launching I had allocated and initialised a class that I want to be viewed when the app first launches with the navigation bar on the top of it.

So this is the code I have did to add the class to navigation bar

- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    // Override point for customization after application launch.

    // Add the view controller's view to the window and display.
    [window addSubview:navController.view];
    //test is the class that i want to be viewed first when  the app launches first
    test *t = [[test alloc]initWithNibName:@"test" bundle:nil];
    [navController.view addSubview:t.view];
    [window makeKeyAndVisible];

    return YES;
}

but the problem is my test class launches but it does not display the navigation bar. What may be the problem?

  • 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-21T17:52:23+00:00Added an answer on May 21, 2026 at 5:52 pm

    Use some like this (add these lines)

    appDelegate.h

    UINavigationController *navController

    @property (nonatomic,retain) UINavigationController *navController;
    

    and in .m

    test *t = [[test alloc]initWithNibName:@"test" bundle:nil]; 
    self.navController=[[[UINavigationController alloc] initWithRootViewController:t] autorelease];
    
    [window addSubview:self.navController.view];
     [window makeKeyAndVisible];
    

    it helps you.

    From other view you need to make object of the appDelegate class then access the navigation controller of that class

    see this

    yourAppDelegateClass *objAppDelegate=(yourAppDelegateClass *)[[UIApplication sharedApplication] delegate];
    

    now for pushing a view

    SecondView *s=[[[SecondView alloc] initWithNibName:@"yournibName" bundle:nil] autorelease];
    [objAppDelegate.navController pushViewController:s animated:YES];
    

    this concept help you.

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

Sidebar

Related Questions

I have created an iPhone application based on an OpenGL view. Now I would
I have created a window-based application and my problem is I am unable to
I have created View based application , here i need to navigate between views
I am new to iphone development.I have created a view based application.Now i want
I Have a normal view based application and have added an UITabBar component. I
i have created and ipad application. i started off with window based application and
I have created one sample application , based on UIWebview sample and i added
I have created a universal window based application in xcode 4. Additionally I created
Hi i have a strange issue after adding my UIViewController.view to my Application Window.
I have created a SQL DB-based winforms application, and I want to deploy it

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.