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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T16:22:17+00:00 2026-06-07T16:22:17+00:00

i’m building a table view that has an external delegate controller, and it’s created

  • 0

i’m building a table view that has an external delegate controller, and it’s created by code, not by storyboard. I have an issue with cells, they are not show, despite execution is reaching correctly delegate methods:

build method:

-(void)buildCategorias{

    CGRect twitterFrame = CGRectMake(105, 83, 600, 568);

    categoriasView = [[UIView alloc] initWithFrame:twitterFrame];

    CGRect scrollViewFrame = CGRectMake(105, 83, 400, 568);

    categoriasTableView = [[UITableView alloc] initWithFrame:scrollViewFrame];

    categoriasController = [[categoriasViewController alloc] init];

    categoriasController.categorias = [[NSArray alloc] initWithObjects:@"Gafas", @"Relojes", @"Pantalones", @"Deportivas", @"Cazadoras", nil];

    [categoriasTableView setDelegate:categoriasController];

    [categoriasTableView setDataSource:categoriasController];

    [self.categoriasView addSubview:categoriasTableView];

    [categoriasTableView reloadData];

    [self.view addSubview:categoriasView];



}

Custom cell: categoriasCell.h

@interface categoriasCell : UITableViewCell{

    UILabel *title;

}

@property (nonatomic, strong) IBOutlet  UILabel *title;

@end

categoriasCell.m

@implementation categoriasCell

@synthesize title;

- (id)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        // Initialization code
    }
    return self;
}

Table view delegate:

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

    categoriasCell *cell = [self.tableView 
                      dequeueReusableCellWithIdentifier:@"categorias"];

    if (cell == nil) {
        cell = [[categoriasCell alloc] initWithStyle:UITableViewCellSelectionStyleNone reuseIdentifier:@"categorias"];
    }

    cell.title.text = [categorias objectAtIndex:indexPath.row];


    return cell;
}


- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
#warning Potentially incomplete method implementation.
    // Return the number of sections.
    return 1;
}

    @end

Table view is empty with no content.

Many thanks for your help

  • 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-07T16:22:19+00:00Added an answer on June 7, 2026 at 4:22 pm

    Are there no cells at all, or is there the right number of cells, but they’re empty?

    If there are no cells at all, check that you did implement the other required delegate method (tableView:numberOfRowsInSection:), and that it does in fact returns the number of cells you expect.

    Otherwise, you are probably missing the code to load the cell from its NIB (I am assuming that, given that you’ve got an IBOutlet in your categoriasCell and no code to actually add the title label to the view, you intend the cell to come from a NIB). See Apple’s documentation for how to load the cell’s NIB and use it in your delegate method. If you don’t load it from the NIB, the text field will not be there, and so your cells will be empty.

    And two non-fatal coding/style issues:

    • You are passing UITableViewCellSelectionStyleNone as the style when initializing the cell. You really should be using UITableViewCellStyleDefault here, since the argument is the cell style, not the selection style.
    • Your class name should be capitalized (CategoriasCell instead of categoriasCell).
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm parsing an RSS feed that has an ’ in it. SimpleXML turns this
That's pretty much it. I'm using Nokogiri to scrape a web page what has
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
I've got a string that has curly quotes in it. I'd like to replace
I have this code to decode numeric html entities to the UTF8 equivalent character.
I have a French site that I want to parse, but am running into
I have this code: - (void)parser:(NSXMLParser *)parser foundCDATA:(NSData *)CDATABlock { NSString *someString = [[NSString
I have an MVC Razor view @{ ViewBag.Title = Index; var c = (char)146;
I need a function that will clean a strings' special characters. I do NOT
I have a view passing on information from a database: def serve_article(request, id): served_article

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.