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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:34:54+00:00 2026-05-25T09:34:54+00:00

After loading a tableview with custom cells all looks fine and scrolling down is

  • 0

After loading a tableview with custom cells all looks fine and scrolling down is fine.
When I scroll up the cells above appear blank. They are in fact fully functional as they can still be selected and then they go off to the details pages.
The code cellForRowAtIndexPath is executed for the returning row and returns the cell as I would expect with the right details. It just isn’t displayed.
Any thoughts/help would be appreciated.

The code below is what I have been using.

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


    static NSString *CustomCellIdentifier = @"CustomCellIdentifier";

    CustomCell *cell = (CustomCell *)[tableView dequeueReusableCellWithIdentifier:CustomCellIdentifier];
    if (cell == nil) {

        NSArray *nib = [[NSBundle mainBundle] loadNibNamed:@"CustomCell" owner:self options:nil];
        for (id oneObject in nib) {
            if ([oneObject isKindOfClass:[CustomCell class]]) {
                cell = (CustomCell *)oneObject;
            }
        }
    }

    // Configure the cell.


    Book *aBook = [appDelegate.sortedArray objectAtIndex:indexPath.row];


    //name
    NSString *trimmedString = [aBook.Name stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];
    cell.nameLabel.text = trimmedString;
    //catagory
    NSString *trimmedExperience = [aBook.PrimaryExperience stringByTrimmingCharactersInSet:[NSCharacterSet whitespaceAndNewlineCharacterSet]];

    if ([trimmedExperience isEqualToString:@"1"]) {
        cell.catagoryLabel.text = @"None";
    }
    else if([trimmedExperience isEqualToString:@"2"]){
        cell.catagoryLabel.text = @"Limited";
    }
    else if ([trimmedExperience isEqualToString:@"4"]) {
        cell.catagoryLabel.text = @"Full";

    }
    else {
        cell.catagoryLabel.text = @"";

    }




    cell.distanceLabel.text = [NSString stringWithFormat:@"%1.1f",aBook.distance];


    cell.accessoryType = UITableViewCellAccessoryDetailDisclosureButton;


    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-25T09:34:55+00:00Added an answer on May 25, 2026 at 9:34 am

    The problem lies with the xib file and how it loaded. To cut out the issue and gain total control the following code was substituted for the IB version of the custom cell.

        static NSString *CellTableIdentifier = @"CellTableIdentifier";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellTableIdentifier];
    if (cell == nil) {
        cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:CellTableIdentifier] autorelease];
        CGRect nameLabelRect = CGRectMake(15, 5, 200, 15);
        UILabel *nameLabel = [[UILabel alloc] initWithFrame:nameLabelRect];
        nameLabel.textAlignment = UITextAlignmentLeft;
        nameLabel.font = [UIFont boldSystemFontOfSize:14];
        nameLabel.tag = kNameTag;
        [cell.contentView addSubview:nameLabel];
        [nameLabel release];
    
        CGRect catagoryLabelRect = CGRectMake(15, 26, 100, 15);
        UILabel *catagoryLabel = [[UILabel alloc]initWithFrame:catagoryLabelRect];
        catagoryLabel.textAlignment = UITextAlignmentLeft;
        catagoryLabel.font = [UIFont systemFontOfSize:12];
        catagoryLabel.tag = kExperienceTag;
        [cell.contentView addSubview:catagoryLabel];
        [catagoryLabel  release];
    
        CGRect distanceLabelRect = CGRectMake(210, 26, 70, 15);
        UILabel *distanceLabel = [[UILabel alloc] initWithFrame:distanceLabelRect];
        distanceLabel.textAlignment = UITextAlignmentRight;
        distanceLabel.font = [UIFont boldSystemFontOfSize:12];
        distanceLabel.tag = kDistanceTag;
        [cell.contentView addSubview:distanceLabel];
        [distanceLabel release];
    }
    

    Thanks for helping think this one through. Now the scrolling works perfectly.

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

Sidebar

Related Questions

I am loading a tableview. And on an event, an alertview will appear. After
After loading a PHP template (using jQuery's load function), this simple script won't make
After loading a reference to an assembly with something like: import clr clr.AddRferenceToFileAndPath(r'C:\foo.dll') How
After loading dynamic content to a DIV, I'd like to add a Close option,
I created a TTModelViewController. in the createModel Method i created a TTURLRequestModel. after Loading
What is Lazy Loading? [Edit after reading a few answers] Why do people use
I have a tableview. I need to add cells of the tableview at a
For whatever reason, my jquery loading overlay doesn't load at all under any circumstance
Here is a problem: after loading some visual elements, I need to change something
My page is altered after loading by a lot of jQuery to get the

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.