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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T07:16:03+00:00 2026-05-27T07:16:03+00:00

I am having problems to get my Navigation Controller to run properly! If I

  • 0

I am having problems to get my Navigation Controller to run properly! If I click in the cell of the table at the RootViewController, it appears not the next ViewController.

Error message reads

“Application tried to push a nil view controller on target
.”

So I alloc something wrong, was my guessing, I probably missing something important from the book I follow.

So the problem appears here in my RootViewController.m:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{

    UINavigationController *navigationController= [[UINavigationController alloc]init];

    switch ([indexPath row]) {

        case 0:
            [navigationController pushViewController:kundeViewCon animated:YES];
            break;

        case 1:
            [navigationController pushViewController:kalenderViewCon animated:YES];
            break;

        case 2:
            [navigationController pushViewController:wunschViewCon animated:YES];
            break;
    } 
}

In my AppDelegate.m I am doing the following things to set a RootViewController as the NavigationController:

 - (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions
{
    self.window = [[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]];
    // Override point for customization after application launch.

// Navigation Controller

    RootViewController *rootViewController = [[RootViewController alloc]init];

    navigationController = [[UINavigationController alloc]initWithRootViewController:rootViewController];

    self.window.backgroundColor = [UIColor whiteColor];

    [self.window addSubview:navigationController.view];
    [self.window makeKeyAndVisible];
    return YES;
}

So I got all my other ViewControllers that I want to push, when I click in the Cell. I just can not see my fault or what I am missing!?

Maybe someone can help me and give me a hint! That would be great!

  • 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-27T07:16:04+00:00Added an answer on May 27, 2026 at 7:16 am

    RootViewController already has its navigation controller – you created it in the app delegate. Creating a new navigation controller when you select a cell doesn’t make sense. It should probably look more like this:

    - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
    {
        switch ([indexPath row]) {
            case 0:
                [self.navigationController pushViewController:kundeViewCon animated:YES];
                break;
            case 1:
                [self.navigationController pushViewController:kalenderViewCon animated:YES];
                break;
            case 2:
                [self.navigationController pushViewController:wunschViewCon animated:YES];
                break;
        }
    }
    

    Also, just make sure that when you call -pushViewController:animated: the view controller (i.e. kundleViewCon, kalenderViewCon & wunschViewCon) are non-nil. They look like instance variables or properies – just make sure you are alloc/initing them earlier in your code, like in -viewDidLoad.

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

Sidebar

Related Questions

I'm having some problems with a Navigation controller in my app. Moving from the
I have been having some problems trying to get my PHP running. When I
I'm having some problems trying to get the code below to output the data
I heard that some people where having problems accessing their sites which get their
I'm wanting to get a WCF-over-TCP service working. I was having some problems with
I've been having problems trying to get my website to be crossbrowser.. in IE6
I'm having problems designing a service layer when using a Table per Hierarchy setup
I am having some problems with popping items from the navigation stack and no
I am having problems messing with some css to get it to look the
I'm having some problems trying to get a background upload system working using WebWorkers

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.