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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T17:08:25+00:00 2026-05-26T17:08:25+00:00

[self.countryList reloadRowsAtIndexPaths:[NSArray arrayWithObjects:[NSIndexPath indexPathForRow:6 inSection:0], nil] withRowAnimation:UITableViewRowAnimationNone]; // or NO ;) My problem is

  • 0
[self.countryList reloadRowsAtIndexPaths:[NSArray arrayWithObjects:[NSIndexPath indexPathForRow:6 inSection:0], nil] withRowAnimation:UITableViewRowAnimationNone]; // or NO ;)

My problem is that I have a tableview with 10+ items with only 6 cells in view, but when the data is loaded and the table is scrolled cell 7 has no data in it. How can I reload the data in that 1 cell?

The code above is what I am using and it doesn’t work!

—EDIT—

if (cell == nil) {  

    cell =[[[UITableViewCell alloc] initWithFrame:CGRectZero reuseIdentifier:identifier]autorelease];
    //[cell setBackgroundColor: [UIColor clearColor]];




    mainLabel = [[[UILabel alloc] initWithFrame:CGRectMake(52.0, 0.0, 200.0, 20.0)] autorelease];           
    mainLabel.tag = 1;          
    mainLabel.font = [UIFont systemFontOfSize:14.0];            
    mainLabel.textAlignment = UITextAlignmentLeft;          
    mainLabel.textColor = [UIColor blackColor];
    mainLabel.opaque = YES;
    mainLabel.backgroundColor=[UIColor clearColor];
    [cell.contentView addSubview:mainLabel];

    revenue = [[[UILabel alloc] initWithFrame:CGRectMake(52.0, 20.0, 150.0, 20.0)] autorelease];            
    revenue.tag = 3;            
    revenue.font = [UIFont systemFontOfSize:14.0];          
    revenue.textAlignment = UITextAlignmentLeft;            
    revenue.textColor = [UIColor blackColor];
    revenue.opaque = YES;
    revenue.backgroundColor=[UIColor clearColor];
    [cell.contentView addSubview:revenue];

    promos = [[[UILabel alloc] initWithFrame:CGRectMake(252.0, 20.0, 150.0, 20.0)] autorelease];            
    promos.tag = 4;         
    promos.font = [UIFont systemFontOfSize:14.0];           
    promos.textAlignment = UITextAlignmentLeft;         
    promos.textColor = [UIColor blackColor];
    promos.opaque = YES;
    promos.backgroundColor=[UIColor clearColor];
    [cell.contentView addSubview:promos];

    updates = [[[UILabel alloc] initWithFrame:CGRectMake(252.0, 0.0, 200.0, 20.0)] autorelease];            
    updates.tag = 5;            
    updates.font = [UIFont systemFontOfSize:14.0];          
    updates.textAlignment = UITextAlignmentLeft;            
    updates.textColor = [UIColor blackColor];
    updates.opaque = YES;
    updates.backgroundColor=[UIColor clearColor];
    [cell.contentView addSubview:updates];

    photo = [[[UIImageView alloc] initWithFrame:CGRectMake(0.0, 0.0, 50.0, 50.0)] autorelease];
    photo.contentMode= UIViewContentModeScaleToFill;
    photo.tag = 2;
    photo.opaque = YES;
    photo.backgroundColor=[UIColor clearColor];
    [cell.contentView addSubview:photo]; 

}    
else {
    cell.clearsContextBeforeDrawing=YES;
    mainLabel = (UILabel *)[cell.contentView viewWithTag:1];    
    photo = (UIImageView *)[cell.contentView viewWithTag:2];
    promos=(UILabel *)[cell.contentView viewWithTag:4];
    revenue=(UILabel *)[cell.contentView viewWithTag:3];
    updates=(UILabel *)[cell.contentView viewWithTag:5];


    if(photo.image){
        photo.image=nil;
    }
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSCachesDirectory, NSUserDomainMask, YES);
    NSString *documentsDirectory = [paths objectAtIndex:0];
    NSString *imageURL =[NSString stringWithString:[(arrayResults*)[tweets objectAtIndex:indexPath.row] myCountryIcon]];

    NSArray *myArray = [imageURL componentsSeparatedByString: @"/"];
    NSString *fileName = [NSString stringWithString:[myArray lastObject]];
    NSString *dataPath = [documentsDirectory stringByAppendingPathComponent:@"/AppIcons"];
    NSString* path = [dataPath stringByAppendingPathComponent:fileName];
    UIImage* image = [UIImage imageWithContentsOfFile:path];
    if (!image) {

        UIApplication* app = [UIApplication sharedApplication];
        app.networkActivityIndicatorVisible = YES;
        // Create an array with the URL and name.  
        NSMutableArray *arr = [[NSMutableArray alloc] initWithObjects:fileName,imageURL, nil  ];  


        [self performSelectorInBackground:@selector(loadImageInBackground:)  withObject:arr]; 
        [arr release];


    }               
    else{
        photo.image=image;


    }
    NSString*promostext=[[NSString alloc] initWithFormat:@"promos:%@",[[(arrayResults*)[tweets objectAtIndex:indexPath.row] mypromos]stringValue] ];
    NSString*revenuetext=[[NSString alloc] initWithFormat:@"revenue:%@",[(arrayResults*)[tweets objectAtIndex:indexPath.row] myrevenue] ];
    NSString*updatestext=[[NSString alloc] initWithFormat:@"updates:%@",[[(arrayResults*)[tweets objectAtIndex:indexPath.row] myupdates]stringValue] ];

    mainLabel.text=[(arrayResults*)[tweets objectAtIndex:indexPath.row] myCountryName];
    promos.text=promostext;
    revenue.text=revenuetext;
    updates.text=updatestext;
    [promostext release];
    [revenuetext release];
    [updatestext release];

}
  • 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-26T17:08:25+00:00Added an answer on May 26, 2026 at 5:08 pm

    This is typically a misuse in the recycle/reuse mechanism of cellForRowAtIndexPath:.

    Cells are reused when you scroll to avoid allocating too much UITableViewCells. So you need to set the content of the cell in cellForRowAtIndexPath: in both case, either if the cell just have been allocated (cell==nil) or if the cell has been reused (cell!=nil).

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

Sidebar

Related Questions

self.myArray = [NSArray arrayWithObjects: [NSArray arrayWithObjects: [self generateMySecretObject], [self generateMySecretObject],nil], [NSArray arrayWithObjects: [self generateMySecretObject],
Assuming self.tableView is a UITableView instance variable that I created, can anyone explain the
[[self mainFrame] loadHTMLString:@<html><body><link href='main.css' rel='stylesheet' type='text/css' /></body></html> baseURL:nil]; I am trying to load a
I'm attempting to setup a MenuItem that will have a submenu of page numbers
I have self join table. This table is being used to join up to
My self as a Front End Developer, for many years I have resolved many
self.timer = [NSTimer scheduledTimerWithTimeInterval:1 target:self selector:@selector(updateTimerDisplay) userInfo:nil repeats:YES]; [runLoop addTimer:self.timer forMode:NSRunLoopCommonModes]; This code-snippet is
self.tableView = [[UITableView alloc] initWithFrame:self.view.frame style:UITableViewStylePlain]; How do I get the proper size from
return self.var[:] What will that return?
The self-extracting executable that I'm attempting to develop is an installer. An end-user will

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.