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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T07:04:14+00:00 2026-05-28T07:04:14+00:00

I have a tableview with a lot of entries divided into multiple sections and

  • 0

I have a tableview with a lot of entries divided into multiple sections and inside that I have multiple rows.I have a button modelled as a checkbox in each rows. The checkboxes(buttons) can be activated/deactivated when pressed. I am loading an image on the button(checkbox) based on the status, whether it is checked or not. Everything is going fine, until I try to drag my UITableview downwards and then go up, only to find some of my checked checkboxes automatically unchecked. I kind of figured that, this was caused due to the use of

 dequeuereusablecellwithidentifier

I want to avoid this strange behavior of my tableview. Need help in this case.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
static NSString *CellIdentifier = @"Cell";
    UITableViewCell *cell = [tableView dequeueReusableCellWithIdentifier:CellIdentifier];
if (cell == nil) {
    cell = [[[UITableViewCell alloc] initWithStyle:UITableViewCellStyleSubtitle reuseIdentifier:CellIdentifier] autorelease];
    UIButton *checkBox = [[UIButton alloc] init];
    checkBox.tag = contact.contactID;
    [cell.contentView addSubview:checkBox];
    [checkBox setFrame:CGRectMake(6,14,20,20)];
    [checkBox release];
}
UIButton *checkBox = (UIButton *)[cell.contentView viewWithTag:contact.contactID];

if(isActivDeactivButton)
{
    [checkBox setImage:[UIImage imageNamed:@"disabled_checkbox.png"] forState:UIControlStateNormal]; 
   }
else{
   [checkBox setImage:[UIImage imageNamed:@"selected_checkbox.png"] forState:UIControlStateNormal];
 }
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-28T07:04:14+00:00Added an answer on May 28, 2026 at 7:04 am

    I replaced

    checkBox.tag = contact.contactID;
    

    with

    checkBox.tag = 111;
    

    This solved the problem as my contactID values were changing during scroll.

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

Sidebar

Related Questions

I have a tableView that's loosely based on the DetailViewController in ye olde SQLiteBooks.
I have a tableview with large images that fill the cells and the row
I have a tableview that occupies only the bottom third of my view. I
I have a tableView:didSelectRowAtIndexPath: where I create a ViewController-Instance each time an item is
I have a Tableview on AppDelegate That calls a SecondView (dvController) when DidSelectRowAtIndexPath using:
I have a tableView with sections, which could be opened and closed. So, when
I have a tableView with a lot of field, like a form. The question
I've got a NavCtrl and on top of that I have a TableView/ctrl, then
I have tableView with a lot of cells. I need to remove cells, which
I have a tableView that shows a list of rss feeds in it's cells,

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.