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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T22:27:26+00:00 2026-05-20T22:27:26+00:00

i am creating an application which make uses of tabbar.i have created a function

  • 0

i am creating an application which make uses of tabbar.i have created a function named setuptabbar which calls all the classes that use tab bar . this my code.

-(void)setupTabbar{
    //this is used to allocate space for tab bar item.
    TJourneylistController *journeylist =[[TJourneylistController alloc]initWithNibName:nil bundle:nil];
    UINavigationController *journeylistnavigation =[[UINavigationController alloc]initWithRootViewController:journeylist];
    [journeylist.tabBarItem initWithTitle:@"Journey List" image:[UIImage imageNamed:@""] tag:2];
    [journeylist release];

    TAppStoreController *appstore =[[TAppStoreController alloc]initWithNibName:nil bundle:nil];
    UINavigationController *appstorenavigation =[[UINavigationController alloc]initWithRootViewController:appstore];
    [appstore.tabBarItem initWithTitle:@"App Stroe" image:[UIImage imageNamed:@""] tag:1];
    [appstore release];

    TSettingsController *settings =[[TSettingsController  alloc]initWithNibName:nil bundle:nil];
    UINavigationController *settingsnavigation =[[UINavigationController alloc]initWithRootViewController:settings];
    [settings.tabBarItem initWithTitle:@"Journey List" image:[UIImage imageNamed:@""] tag:3];
    [settings release];

    TAboutController *about =[[TAboutController alloc]initWithNibName:nil bundle:nil];
    UINavigationController *aboutnavigation =[[UINavigationController alloc]initWithRootViewController:about];
    [about.tabBarItem initWithTitle:@"Journey List" image:[UIImage imageNamed:@""] tag:4];
    [about release];

    mTabController.viewControllers = [[NSArray alloc] initWithObjects:appstorenavigation,journeylistnavigation,settingsnavigation,aboutnavigation,nil];
    [appstorenavigation release];
    [journeylistnavigation release];
    [settingsnavigation release];
    [aboutnavigation release];
}


- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {    

    // Override point for customization after application launch.

    mTabController = [[UITabBarController alloc]init];
    [self setupTabbar];
    if([launchOptions objectForKey:UIApplicationLaunchOptionsRemoteNotificationKey]!=nil)
        mTabController.selectedViewController = [mTabController.viewControllers objectAtIndex:0];
    [mTabController presentModalViewController:mViewController animated:YES];
     //Screen *screen =[[Screen alloc]initWithNibName:@"Screen" bundle:nil];
    [window addSubview:mTabController.view];
    [self.window makeKeyAndVisible];
    //[screen release];

    return YES;
}

But when i run the project it gives me an error that ‘Application tried to present a nil modal view controller.What is the problem.

  • 1 1 Answer
  • 1 View
  • 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-20T22:27:27+00:00Added an answer on May 20, 2026 at 10:27 pm

    In you following line:

    [mTabController presentModalViewController:mViewController animated:YES];
    

    You are presenting mViewController from mTabController. What is mViewController ? It’s maybe because mViewController is never allocated. If you remove this line I think your code is working.

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

Sidebar

Related Questions

I have .NET 3.5 web application which uses some COM dll created in VB6.
I have an Android Application which uses JNI calls. Now i want this application
i am creating an application which includes dynamic pages. actually, i created some dynamic
I'm creating an application which works on Froyo until Jelly Beans. I have two
I am creating an application which involves so many web-service calls. I am using
I'm creating an application in Visual Studio which uses web reference. The URL for
I'm creating a web application which loads tabs using AJAX. My problem is that
I am creating an application that uses the MS Ribbon Control. The ribbon has
I have a command-line application written in C++ and built with gcc/make that runs
I am creating an application which needs to detect the make and model of

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.