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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T04:16:36+00:00 2026-06-08T04:16:36+00:00

I have a UITableViewCell subclass which has a property called entryView, in place of

  • 0

I have a UITableViewCell subclass which has a property called entryView, in place of the read-only cell.contentView. I thought I was using the table view correctly – remembering that the cells get re-used for every entry, and everything needs to be added every time. Occasionally when scrolling however, the entryView will disappear on a cell. The cell will still be there, but the entryView appears to be removed from superview. Here’s my cellForRowAtIndexPath:

-(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *CellIdentifier = @"Cell";
    JTimelineCell *cell = (JTimelineCell *)[tableView dequeueReusableCellWithIdentifier:CellIdentifier];
    if (cell == nil) {
        cell = [[JTimelineCell alloc] initWithStyle:UITableViewCellStyleDefault
                                    reuseIdentifier:CellIdentifier];

    }

    JTimelineCellContentView *contentView;

    Entry *entry = [_fetchedResultsController objectAtIndexPath:indexPath];

    if ([self.cellContentCache objectForKey:entry.entryID]) {
        contentView = [self.cellContentCache objectForKey:entry.entryID];

        contentView.frame = cell.bounds;
        [contentView setNeedsDisplay];
    }
    else {

        contentView = [[JTimelineCellContentView alloc] initWithFrame:cell.bounds];


        [self.cellContentCache setObject:contentView forKey:entry.entryID];

        contentView.time = [NSDate timeStringForTime:entry.creationDate];

        contentView.message = entry.message;

        [cell setNeedsDisplay];
}

    [cell.entryView removeFromSuperview];
    cell.entryView = contentView;

    [cell addSubview:cell.entryView];

    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-06-08T04:16:38+00:00Added an answer on June 8, 2026 at 4:16 am

    I believe you posted something similar in a different question. You cannot cache the contentView of a cell. You CAN cache images, strings, numbers, values etc – but in the end, when you get a cell, you need to retrieve the elements that will DISPLAY those values, and then set their values to do so. So you can cache images, strings, CGRects, etc – and then when asked to populate a cell, you can look at your cache, and if valid then get the values you have cached. If the cache is not set, then you need to create them from scratch.

    Every time you get a cell for a particular section/row, its different. It maybe have old values in it, or it may be new. You need to set each GUI element for each item. One way to make it easy to find those elements is give each a unique tag, so you can use [cell.contentView viewForTag:xxx] to get the item, then set it.

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

Sidebar

Related Questions

I have a custom UITableViewCell subclass. I have set the contentView of my cell
I have a UITableView with custom Cell (subclass of UITableViewCell). Each cell view has
I have a UITableViewCell subclass which draws a rectangular vertical line of 5px width
I have a UISwitch inside a custom UITableViewCell (the subclass of which I call
Similar to this question I have a custom subclass of UITableViewCell that has a
I have a UITableView subclass and a UITableViewCell subclass that I'm using for cells.
I have a UITextView subclass that has an NSIndexPath property that is inside a
I have a custom view class which is a subclass of UITableViewCell. I have
I have a UITableView and a UITableCell subclass. Each table cell has two scrollviews
I have created a class named ListCell which is a subclass of UITableViewCell .

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.