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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:05:28+00:00 2026-06-18T08:05:28+00:00

I use tableview with reusable cells. On each cell I have a textField with

  • 0

I use tableview with reusable cells. On each cell I have a textField with text, which I can modify. If text is empty, I delete that cell.

Lets say that we had 100 rows and we want to modify row number 1: we tap on it, give an empty string @””, scroll down to position number 50 and tap on this cell.

What now is going is that we detect tap gesture on another cell and I call method textFieldDidEndEditing: to see should I remove this cell from tableview. I use cellForRowAtIndexPath: to get the modified cell.

The problem is that there appear other cells with empty textField. I delete modified cell, but only one. I think that this is a problem with reusable cells.

Can anybody can help me with this problem?

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

    StandardCellWithImage *cellImage = (StandardCellWithImage *)[tableView dequeueReusableCellWithIdentifier:ImageIdentyfier];

    if(cellImage == nil) {
        cellImage = [[StandardCellWithImage alloc] initWithStyle:UITableViewCellStyleDefault reuseIdentifier:ImageIdentyfier];
    }
    cellImage.nameLabel.delegate = self;
    Item *item  = [self.mutableFetchResults objectAtIndex:indexPath.row];
    cellImage.nameLabel.text = item.itemText;
    cellImage.infoLabel.text = item.itemInfo;
    cellImage.checkbox.userInteractionEnabled = YES;
    cellImage.nameLabel.userInteractionEnabled = NO;
    if(item.itemIsChecked.boolValue == YES) {
        cellImage.checkbox.tag = indexPath.row;
        [cellImage.tapGesture addTarget:self action:@selector(didSelectedImageAtIndexPath:)];
        cellImage.checkbox.image = [UIImage imageNamed:@"checkbox-checked.png"];
    } else {
        cellImage.checkbox.tag = indexPath.row;
        [cellImage.tapGesture addTarget:self action:@selector(didSelectedImageAtIndexPath:)];
        cellImage.checkbox.image = [UIImage imageNamed:@"open-checkbox.png"];
    }
    return cellImage;
}
  • 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-18T08:05:29+00:00Added an answer on June 18, 2026 at 8:05 am

    When you scroll from row 1 to row 50, already existing cells are reused – including your cell with empty textField. That is why you see it several times and why your delete routine removed only one instead of all.

    Sounds like your cell creation at cellForRowAtIndexPath method needs fixing to make sure empty textfield is not automatically copied to recycled cells. Without seeing any code, this exercise is left to you.

    Looked at code, thanx. Could not see any “easy” fix, so proposing that you should avoid the problem. So instead of checking cell taps, maybe you should check list scrolling.

    The problem you have exists only because cell, which was being edited, was recycled due user scrolling the list. Therefore remove the problem by a) don’t let user to scroll while editing text or b) stop text edit when user starts scrolling.

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

Sidebar

Related Questions

I have this code that where I would normally use one line: if (tableView
Is that possible to use tableView cells like a button? In my app I
I use a grouped tableview and custom cells which I load from nib. When
I have a view which consists of a tableview and a navigation bar. For
How can I make the left side use a tableview? It has the music,
Tableview use a QSqlRelationalTableModel. How can I insert data from a column in the
How would I use a tableView as a value selector? So I have a
I'm building an app where I use custom tableView Cells and i'm not really
How can I give a tableView cell background color the fade effect as soon
I'm working on a tableview, which displays more than one line of text in

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.