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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 7, 20262026-06-07T15:38:15+00:00 2026-06-07T15:38:15+00:00

I have a TableView that I am trying to load data into. From the

  • 0

I have a TableView that I am trying to load data into. From the NSLog displays the data is correct and present. However the following method isn’t being called, e.g. the NSLog comments are not appearing at all.:

- (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];    
    // UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier]; 
}
NSString *cellValue = [listOfStates objectAtIndex:indexPath.row];
cell.textLabel.text = cellValue;
return cell; 
NSLog(@"Passed: cellForRowAtIndexPath");

}

Similarly the init isn’t being run either. I though init was always run, if present?

- (id)init { 
    if ((self = [super init])) {
    listOfStates = [[NSMutableArray alloc] init];
    stateName = [[NSString alloc] init];
    NSLog(@"INIT StateName %@", stateName);
    }
return self;
 NSLog(@"Passed: init");
}

Any ideas?

  • 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-07T15:38:17+00:00Added an answer on June 7, 2026 at 3:38 pm

    tableView:cellForRowAtIndexPath: is called by the table view on its data source when a cell is needed, this can be either when a cell is first shown, or when the user is scrolling and the cell will appear

    your init method is not being called because UITableView uses initWithFrame:style: and UITableViewController (it wasnt clear which init you are trying to override) uses initWithStyle:, not the “plain” init method. If you want to do custom setup you should override these methods

    and as the other answers have mentioned, anything you put after a return statement will never be executed

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

Sidebar

Related Questions

I am trying to load a new view from a tableview:didSelectRowAtIndexPath: method that happens
I have a tableView that present a list of Books, each of the table
I have a TableView with 10 sections that are loaded from a plist file
I am trying to re-load a table every time some data I get from
I am trying to have a tableview that leads to another tableview whose list
I'm trying to load some data from a plist file. It contains an NSArray
I have an NSMutableArray and I load my tableview from it. Now I have
Xcode 4.2 iPhone Project I am trying to create a tableView that's populated from
I have a UITableView that I am placing inside a TabView. I am trying
I have a tableView that's loosely based on the DetailViewController in ye olde SQLiteBooks.

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.