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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T18:09:05+00:00 2026-05-24T18:09:05+00:00

i have an issue regarding UitableViewCell. the issue is that i have made a

  • 0

i have an issue regarding UitableViewCell. the issue is that i have made a custom cell and i have a check box image button in that cell. i check and uncheck it. it works fine but the issue is that when i select Row # 1. it also selects row # 10 same goes with other rows like for 2 it will auto select row # 11. i am showing 10 rows at a time.

here is my code for CellForIndexPath

static NSString *cellIdentifier = @"Cell";
InterestsTableViewCell *cell = (InterestsTableViewCell *) [tableView dequeueReusableCellWithIdentifier:cellIdentifier];
if (cell==nil) {
    NSArray *arrayNibs = [[NSBundle mainBundle] loadNibNamed:@"InterestsTableViewCell" owner:self options:nil];
    cell = [arrayNibs objectAtIndex:0];
    cell.delegate = self;
    cell.total = [dataArray count];
}

cell.tag = indexPath.row;

cell.lblTitle.text = [dataArray objectAtIndex:indexPath.row];

if (indexPath.row==0) {
    cell.imgBg.image = [UIImage imageNamed:@"tableCell_top_default.png"];
}else if(indexPath.row == [dataArray count]-1){
    cell.imgBg.image = [UIImage imageNamed:@"tableCell_bottom_default.png"];
}else{
    cell.imgBg.image = [UIImage imageNamed:@"tableCell_middle_default.png"];
}

return cell;

Plus i am detecting touch so that i can change the background image (i have an other image as background). Code for Touch Began (in custom cell is below)

-(void)touchesBegan:(NSSet *)touches withEvent:(UIEvent *)event
//NSLog(@"%i",tag);
isSelected = !isSelected;

btnTickMark.selected = !btnTickMark.selected;
(isSelected ?  (onImage = YES) : (onImage = NO));

Can somebody help me in this issue that why 2 rows are selected when i click a row.

Thanks in advance

  • 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-24T18:09:06+00:00Added an answer on May 24, 2026 at 6:09 pm

    This is because UITableView dequeues the cell. As you are showing 10 rows per screen it totally fits, that row 11 appears checked as it is dequeued from row 1.

    To avoid that behavior you have to add a check to tableView:cellForRowAtIndexPath: to set your checked parameter for each cell – like the text you set for every cell.

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

Sidebar

Related Questions

I have an issue regarding an recursive count which works well in SQL server,
I have an issue regarding link button, On my website i have got a
I have an issue regarding how to check the reachability of a certain url.
There have been a few questions regarding this issue before; my understanding is that
I have an issue regarding to auto populating a select dropdown from jQuery/JSON data
I have recently run into a particularly sticky issue regarding committing the result of
I have seen a few posts regarding this issue but not one specific to
Please help regarding the following issue. I have enabled the Block popup option in
I have an other active question HERE regarding some hopeless memory issues that possibly
I have issue that is reproduced on g++. VC++ doesn't meet any problems. So

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.