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

The Archive Base Latest Questions

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

I have search the web to learn how to create custom table view (because

  • 0

I have search the web to learn how to create custom table view (because I want to hide the navigator bar for a specific view) and I am following each step. However, my result doesn’t display the table.

Here is my .h file

#import <UIKit/UIKit.h>

@interface HallFameControllerViewController : UIViewController
    <UITableViewDelegate, UITableViewDataSource>{

    NSArray *leaders;
}

@property (strong, nonatomic) NSArray *leaders;

@end

and my .m file

#import "HallFameControllerViewController.h"

@interface HallFameControllerViewController ()

@end

@implementation HallFameControllerViewController

@synthesize leaders;

- (void)viewDidLoad
{
    [super viewDidLoad];
    leaders = [NSArray arrayWithObjects:@"Player #1", @"Player #2", @"Player #3", nil];
}

- (void) viewDidUnload{

    self.leaders = nil;
}

- (void) viewWillAppear:(BOOL)animated{

    [self.navigationController setNavigationBarHidden:NO];
}

- (void)didReceiveMemoryWarning
{
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


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

- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    // Return the number of rows in the section.
    return [leaders count];
}

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier forIndexPath:indexPath];

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

    // Configure the cell.
    cell.textLabel.text = [self.leaders objectAtIndex: [indexPath row]];
    return cell;
}
@end

In my storyboard, I have created a ViewController and inside I have 1 label and 1 TableView. I have set Custom Class for my ViewController to “HallFameControllerViewController” and dataSource, delegate for Table View to “HallFameControllerViewController” as well. Results, Label is there but no table.

I have some printf() statements in side .m file, viewDidLoad() executed but cellForRowAtIndexPath() no!

What I am doing wrong here? In addition, what is cellIdentifier and why has set to “Cell” (automatically)?

Thanks in advance.

  • 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-14T10:49:29+00:00Added an answer on June 14, 2026 at 10:49 am

    You need to extend UITableViewController, not UIViewController. Then you don’t need to add the UITableViewDataSource or UITableViewDelegate protocols to your interface declaration.

    You can use a plain view controller but its more work. You never actually added a UITableView anywhere. You simply implemented the table view methods (which you still need to do).

    You need to update your numberOfSectionsInTableView:. Returning 0 is going to leave you an empty table, even after fixed the other issues.

    So change this:

    @interface HallFameControllerViewController : UIViewController <UITableViewDelegate, UITableViewDataSource>{
    

    to:

    @interface HallFameControllerViewController : UITableViewController {
    

    And change this:

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
        return 0;
    }
    

    to:

    - (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {
        return 1;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have search the web. I have tried color-theme (perhaps I need to create
I have search through the web to figure this out but no luck. I
I have a project using Lucene3.5 already. Now i need to provide web search
I have a web application that allows users to enter search criteria and the
Currently I have an algorithm which somewhat looks like web-spiders or file search systems
hai I have a magento web site. In this the search function compare with
I have search all over the web but could not find answer to this
When I perform a web search on my custom search engine, it returns 2,240
I have web search form, When i submit my search in the search box,
I have advanced search on my web page, now how this works is as

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.