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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T08:22:41+00:00 2026-05-28T08:22:41+00:00

I am in the process of creating my open grid view. I created a

  • 0

I am in the process of creating my open grid view.

I created a custom cell that looks like so:

enter image description here

I handle populating it like so:

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    static NSString *MyIdentifier = @"Cell";

    TableGalleryCustomCell *cell = (TableGalleryCustomCell*)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];

    if( cell == nil) {
        NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"TableGalleryCustomCell" owner:nil options:nil];
        for (id currentObject in topLevelObjects) {
            if ([currentObject isKindOfClass:[UITableViewCell class]]) {
                cell = (TableGalleryCustomCell*)currentObject;
                break;
            }
        }
    }

    if (countingIndex < [[[self.appDelegate rssParser] rssItems] count]) {
        cell.firstAddress.text = [[[[self.appDelegate rssParser] rssItems] objectAtIndex:countingIndex] Address];
        cell.firstPrice.text = [[[[self.appDelegate rssParser] rssItems] objectAtIndex:countingIndex] Deposit];
        if ([[[[[[self appDelegate] rssParser]rssItems]objectAtIndex:countingIndex] imageURLs] count] != 0 ) {
            [cell.firstImage setImageWithURL:[NSURL URLWithString:[[[[[self.appDelegate rssParser] rssItems] objectAtIndex:countingIndex] imageURLs] objectAtIndex:0.0]]];
            cell.firstImage.tag = countingIndex;
        }
    }

    countingIndex++;
    if (countingIndex < [[[self.appDelegate rssParser] rssItems] count]) {
        cell.secondAddress.text = [[[[self.appDelegate rssParser] rssItems] objectAtIndex:countingIndex] Address];
        cell.secondPrice.text = [[[[self.appDelegate rssParser] rssItems] objectAtIndex:countingIndex] Deposit];
        if ([[[[[[self appDelegate] rssParser]rssItems]objectAtIndex:countingIndex] imageURLs] count] != 0 ) {
            [cell.secondImage setImageWithURL:[NSURL URLWithString:[[[[[self.appDelegate rssParser] rssItems] objectAtIndex:countingIndex] imageURLs] objectAtIndex:0.0]]];
            cell.secondImage.tag = countingIndex;
        }
    }

    countingIndex++;
    if (countingIndex < [[[self.appDelegate rssParser] rssItems] count]) {
        cell.thirdAddress.text = [[[[self.appDelegate rssParser] rssItems] objectAtIndex:countingIndex] Address];
        cell.thirdPrice.text = [[[[self.appDelegate rssParser] rssItems] objectAtIndex:countingIndex] Deposit];
        if ([[[[[[self appDelegate] rssParser]rssItems]objectAtIndex:countingIndex] imageURLs] count] != 0 ) {
            [cell.thirdImage setImageWithURL:[NSURL URLWithString:[[[[[self.appDelegate rssParser] rssItems] objectAtIndex:countingIndex] imageURLs] objectAtIndex:0.0]]];
            cell.thirdImage.tag = countingIndex;
        }
    }

    countingIndex++;
    if (countingIndex < [[[self.appDelegate rssParser] rssItems] count]) {
        cell.fourthAddress.text = [[[[self.appDelegate rssParser] rssItems] objectAtIndex:countingIndex] Address];
        cell.fourthPrice.text = [[[[self.appDelegate rssParser] rssItems] objectAtIndex:countingIndex] Deposit];
        if ([[[[[[self appDelegate] rssParser]rssItems]objectAtIndex:countingIndex] imageURLs] count] != 0 ) {
            [cell.fourthImage setImageWithURL:[NSURL URLWithString:[[[[[self.appDelegate rssParser] rssItems] objectAtIndex:countingIndex] imageURLs] objectAtIndex:0.0]]];
            cell.fourthImage.tag = countingIndex;
        }
    }

    countingIndex++;


    return cell;
}

It is a bit messy but it works…..until I scroll. After the image is loaded then scrolled off the screen the image disappears.

I believe that it maybe due to the imageViews of the cells being lost?

I tried the exact same implementation but with only 1 imageView in each cell and all works great.

Any point in the right direction would be very much appreciated.

I appreciate any help and thank you for your time.

  • 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-28T08:22:42+00:00Added an answer on May 28, 2026 at 8:22 am

    I believe the problem is because your cells are being dequeued and you are populating cells in tableView:cellForRowAtIndexPath: using row information other than the indexPath.row.

    Maybe try something along the following lines:

    - (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
    {
        NSArray         * rssItems;
        id                rssItem;
        static NSString * MyIdentifier = @"Cell";
    
        TableGalleryCustomCell *cell = (TableGalleryCustomCell*)[tableView dequeueReusableCellWithIdentifier:MyIdentifier];
    
        if( cell == nil) {
            NSArray *topLevelObjects = [[NSBundle mainBundle] loadNibNamed:@"TableGalleryCustomCell" owner:nil options:nil];
            for (id currentObject in topLevelObjects) {
                if ([currentObject isKindOfClass:[UITableViewCell class]]) {
                    cell = (TableGalleryCustomCell*)currentObject;
                    break;
                }
            }
        }
    
        rssItems =  [[self.appDelegate rssParser] rssItems];
        if (indexPath.row < [rssItems count]) {
            rssItem = [rssItems objectAtIndex:indexPath.row];
            cell.firstAddress.text = [rssItem Address];
            cell.firstPrice.text   = [rssItem Deposit];
            if ([[rssItem imageURLs] count] != 0 ) {
                [cell.firstImage setImageWithURL:[NSURL URLWithString:[[rssItem imageURLs] objectAtIndex:0.0]]];
                cell.firstImage.tag = indexPath.row;
            }
        }
    
        return cell;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Suppose that a process is creating a mutex in shared memory and locking it
I'm in the process of creating a class that stores metadata about a particular
I'm in the process of creating an app. I'd like to have a pared
I'm in the process of creating a traditional desktop application, and I'd like to
I'm creating a global semaphore object in a process like this: CreateSemaphore(NULL, 1, 1,
Ok basically im in the process of creating an app that loads gestures I
I am creating a process using proc_open in one PHP script. How do i
I'm in the process of creating a header section for a webapp. I'm having
I'm in the process of creating an Intranet site using Windows Authentication. Maybe I'm
I am in the process of creating an XML Schema and one of my

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.