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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T10:26:35+00:00 2026-05-16T10:26:35+00:00

I am trying to figure out how to use a UINavigationController, UITabBarController, and UITableView

  • 0

I am trying to figure out how to use a UINavigationController, UITabBarController, and UITableView together.

I started with a Navigation-based app, and at one point push a UIViewController (called CarViewController) onto the navigationController. I want to use a TabBar within the CarViewController, so I dragged a UITabBarController into CarViewController‘s .xib, declared a IBOutlet UITabBarController *tabBarController in the .h file, synthesized it in the .m file, then in Interface Builder I connected File's Owner -> tabBarController to the tab bar controller and made File’s Owner the tab bar’s delegate.

This works just fine with tabs for other UIViews, but the problem I’m having is that I cannot get any tabs to work that have UITableViewControllers. The debugger claims there’s an error in tableView:numberOfRowsInSection but I have an NSLog in there that’s not even being run.

Here’s what the debugger output is:

*** Terminating app due to uncaught exception 'NSInvalidArgumentException', reason: '-[UIViewController tableView:numberOfRowsInSection:]: unrecognized selector sent to instance 0x592f1d0'
*** Call stack at first throw:
(
 0   CoreFoundation                      0x0238e919 __exceptionPreprocess + 185
 1   libobjc.A.dylib                     0x024dc5de objc_exception_throw + 47
 2   CoreFoundation                      0x0239042b -[NSObject(NSObject) doesNotRecognizeSelector:] + 187
 3   CoreFoundation                      0x02300116 ___forwarding___ + 966
 4   CoreFoundation                      0x022ffcd2 _CF_forwarding_prep_0 + 50
 5   UIKit                               0x001c9a24 -[UISectionRowData refreshWithSection:tableView:tableViewRowData:] + 1834
 6   UIKit                               0x001cb9c1 -[UITableViewRowData rectForFooterInSection:] + 108
 7   UIKit                               0x001cb24d -[UITableViewRowData heightForTable] + 60
 8   UIKit                               0x0008e596 -[UITableView(_UITableViewPrivate) _updateContentSize] + 333
 9   UIKit                               0x0007db7e -[UITableView noteNumberOfRowsChanged] + 123
 10  UIKit                               0x0008a1d2 -[UITableView reloadData] + 773
 11  UIKit                               0x000873f4 -[UITableView layoutSubviews] + 42
 12  QuartzCore                          0x03a630d5 -[CALayer layoutSublayers] + 177
 13  QuartzCore                          0x03a62e05 CALayerLayoutIfNeeded + 220
 14  QuartzCore                          0x03a6264c _ZN2CA7Context18commit_transactionEPNS_11TransactionE + 302
 15  QuartzCore                          0x03a622b0 _ZN2CA11Transaction6commitEv + 292
 16  QuartzCore                          0x03a69f5b _ZN2CA11Transaction17observer_callbackEP19__CFRunLoopObservermPv + 99
 17  CoreFoundation                      0x0236fd1b __CFRUNLOOP_IS_CALLING_OUT_TO_AN_OBSERVER_CALLBACK_FUNCTION__ + 27
 18  CoreFoundation                      0x02304987 __CFRunLoopDoObservers + 295
 19  CoreFoundation                      0x022cdc17 __CFRunLoopRun + 1575
 20  CoreFoundation                      0x022cd280 CFRunLoopRunSpecific + 208
 21  CoreFoundation                      0x022cd1a1 CFRunLoopRunInMode + 97
 22  GraphicsServices                    0x025d92c8 GSEventRunModal + 217
 23  GraphicsServices                    0x025d938d GSEventRun + 115
 24  UIKit                               0x00022b58 UIApplicationMain + 1160
 25  Test Application                    0x000029b4 main + 102
 26  Test Application                    0x00002945 start + 53
 27  ???                                 0x00000001 0x0 + 1
 )
terminate called after throwing an instance of 'NSException'
sharedlibrary apply-load-rules all

Just for reference, here is the applicable code from the UITableViewController’s implementation:

#pragma mark -
#pragma mark Table view data source

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
    // Return the number of sections.
    return 1;
}


- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {
    // Return the number of rows in the section.
    NSLog(@"Hi, this is the function that should be firing but is not!");
    return 5;
}


// Customize the appearance of table view cells.
- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {

    static NSString *CellIdentifier = @"Cell";

    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellIdentifier] autorelease];
    }

    // Configure the cell...
    cell.textLabel.text = @"Test Item";
    return cell;
}

At this point I have a blank project and I’m just trying to mock up the interface, so other than having this mis-structured there’s nothing else going on in the code.

  • 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-16T10:26:35+00:00Added an answer on May 16, 2026 at 10:26 am

    It appears to be calling the UITableViewDelegate methods on a UIViewController. Re-check the connections in IB – occasionally even the best mis-wire things…

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

Sidebar

Related Questions

I'm trying to figure out how to use Emacs Code Browser (ECB) and one
At the moment I'm trying to figure out how use default and custom settings
Trying to figure out which to use.
I'm trying to figure out how to use PredicateBuilder to determine if a specific
I'm trying to figure out how to use NServiceBus in combination withCommon.Logging. I just
I'm trying to figure out how to use the java.util.logging features. All of the
I am trying to figure out how to use Apache Commons IO DirectoryWalker .
I'm trying to figure out how to use RJS to swap between two fields...
i'm trying to figure out how to use ApacheBench and benchmark my website. I
I'm trying to figure out how to use Zend_Db_Table_Abstract correctly. I want to return

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.