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

  • Home
  • SEARCH
  • 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 8801421
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T00:49:46+00:00 2026-06-14T00:49:46+00:00

I have encountered a very strange behavior, when I implemented navigationController. I have a

  • 0

I have encountered a very strange behavior, when I implemented navigationController.
I have a LogInViewController with an UITableView,where cells are populated like this:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {

return 1;

}

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    return 2;
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    if (indexPath.row == 0) {
        return cellUsername;
    }
    if (indexPath.row == 1){
        return cellPassword;
    }
    else{
        return nil;
    }
}

cellUsername and cellPassword are Cells which I created on .xib..
And when i add this LogInViewController as a rootViewController in my appDelegate it works fine!
I wanted to implement a navigationController, so I created RootViewController, with navController @property and in my appDelagate i called it like this

self.window = [[[UIWindow alloc] initWithFrame:[[UIScreen mainScreen] bounds]] autorelease];


RootViewController *rootView = [[RootViewController alloc]init];
rootView.navController = [[UINavigationController alloc] initWithRootViewController:rootView];

self.window.rootViewController = rootView.navController;
[self.window makeKeyAndVisible];
return YES;

And in my RootViewController on viewDidLoad I have this code:

[super viewDidLoad];
self.navController = [[UINavigationController alloc]init];
LogInViewController *loginView = [[LogInViewController alloc]init];
[[self navigationController] pushViewController:loginView animated:YES];

It opens my LogInViewController,but only the first cell,cellUsername is added to my UiTableView, what is wrong?
Am still a beginner,so I might be missing something stupid probably.. but it works wihout navigationController,so am pretty confused..
Thank you!

  • 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-14T00:49:47+00:00Added an answer on June 14, 2026 at 12:49 am

    I’m not sure if this has anything to do with your problem, but you shouldn’t be using this line in your viewDidLoad:

    self.navController = [[UINavigationController alloc]init];
    

    Your RootViewController is already embedded in a navigation controller, so you can just use self.navigationController to get a reference to it.

    I’m also not sure about this code, it may be ok, but it’s not the way it’s usually done:

    RootViewController *rootView = [[RootViewController alloc]init];
    rootView.navController = [[UINavigationController alloc] initWithRootViewController:rootView];
    self.window.rootViewController = rootView.navController;
    

    The usual way to do it is like this:

    RootViewController *rootView = [[RootViewController alloc]init];
    UINavigationController *nav = [[UINavigationController alloc] initWithRootViewController:rootView];
    self.window.rootViewController = nav;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

We have encountered a very strange class not found problem in our web app
I have encountered a very strange issue. Whenever I use the .NET membership provider
I have just encountered very strange problem - my GWT app hosted on Google
I have encountered something very strange, simple WPF application <Window x:Class=ListBoxSelection.MainWindow xmlns=http://schemas.microsoft.com/winfx/2006/xaml/presentation xmlns:x=http://schemas.microsoft.com/winfx/2006/xaml Title=MainWindow
I have encountered a very strange problem in using jQuery load() . I used
I have encountered a very strange problem. The jquery slideshow in the below webpage
i have encountered a very strange issue: i use json.dump to write a file
I have encountered a very strange thing today : I have an app installed
I have encountered a very strange problem and I was wondering, if anyone could
I have encountered a very strange bug in Firefox. I have a javascript function

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.