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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T16:36:31+00:00 2026-05-23T16:36:31+00:00

I have a TableView loading a custom cell and loading the data from a

  • 0

I have a TableView loading a custom cell and loading the data from a JSON string on a server.
The JSON string is parsed to an array of 14 IDs (id_array).

If cell==nil, then I’m using [id_array objectAtIndex:indexPath.row] to get an ID and fetch some more info about for that row from a server, and set up the cell’s labels and image.

When running the app, the UITableView is loading the visible rows [0,1,2,3,4] (cell height is 70px).
When scrolling down the TableView, row [5] is loaded and fetching data from the server, but the problem is that beyond that point – the TableView is repeating those 6 rows instead of requesting new data from the server for the new rows…

But it does request new data for row [5], which is not visible (and not loaded) when the app first runs.

Anyone have any idea why is this happening?
Thanks!

EDIT: Here is my cellForRowAtIndexPath method

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

    if (cell == nil) {
        NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];

        for (id currentObject in topLevelObjects) {
            if ([currentObject isKindOfClass:[UITableViewCell class]]) {
                cell = (CustomCell *)currentObject;

                NSString *appsURL = [NSString stringWithFormat:@"http://myAPI.com?id=%@",[app_ids objectAtIndex:indexPath.row]];
                NSLog(@"row -> %d | id -> %@",indexPath.row,[app_ids objectAtIndex:indexPath.row]);
                NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:appsURL]];
                [cell updateAppInfoForCellWithRequest:request];

                break;
            }
        }
    }

    // Configure the cell...

    return cell;
}
  • 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-23T16:36:32+00:00Added an answer on May 23, 2026 at 4:36 pm

    If you are setting data only if cell==nil, then that is your issue. UITable builds a cache of table view cells, only creating a new one if cell is nil. Therefore, you must set your data each time, i.e. outside of the cell==nil block.

    The example below shows that process. First, grab a cell from the pool, if there isn’t a free cell, create a new one. Set the cell’s values for the appropriate row.

    - (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];
        }
    
        id someData = [id_array objectAtIndex:indexPath.row]
    
        cell.textLabel.text = [someData someString];
    
        return cell;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an array and a tableview that gets its data from the array.
I have a viewController that has a tableView and a custom loading UIView that
I have very custom TableView like Add Contact View in iPhone's Contacts. I like
I am attempting to create a custom tableview where I have a list of
i have a tableviewcontroller and inside it i am trying loading data of the
I have table view to load data from an API call. I am using:
I have a TableView with custom cells. I want a contextual menu to appear
I have a UITableView with custom UITableViewCells. Each cell asynchronously loads an image and
I have a grouped table view with textfields in the tableview. For the keyboard
Have you ever seen any of there error messages? -- SQL Server 2000 Could

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.