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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T18:35:17+00:00 2026-05-21T18:35:17+00:00

In my app if user press on any cell in UITableView then accessoryType of

  • 0

In my app if user press on any cell in UITableView then accessoryType of cell will be set to check mark like following

-(void)Check:(UITableView *)tableView Mark:(NSIndexPath *)indexPath  
{  
[self.tableView cellForRowAtIndexPath:indexPath].accessoryType = UITableViewCellAccessoryCheckmark;  
     buttonCount++;  
    [selectedCellArray addObject:indexPath];  
} 

and if user press the same cell then uncheck will happen as follows

-(void)UnCheck:(UITableView *)tableView Mark:(NSIndexPath *)indexPath  
{  
[self.tableView cellForRowAtIndexPath:indexPath].accessoryType =   UITableViewCellAccessoryNone;  
    buttonCount--;    
     if (buttonCount == 0) {    

        [selectedCellArray removeAllObjects];  
    }  
}    

and i am calling this

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{  
if([tableView cellForRowAtIndexPath:indexPath].accessoryType == UITableViewCellAccessoryCheckmark)
    {  
        [self UnCheck:tableView Mark:indexPath];  
    }  
else  
    {  
        [self Check:tableView Mark:indexPath];

    }

Problem is when i am pressing on 1st cell it call Check method and mark the cell to but when i am scroll down i find 2-3 more cheked cell …even i did not select those cell…i dont know why and how it checked automatically …
i hope some one know where is the problem
thank you very much

  • 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-21T18:35:18+00:00Added an answer on May 21, 2026 at 6:35 pm

    Because cells will be reused by the tableview. Also set the checkmark/accessory type in your tableView:cellForRowAtIndexPath: method.

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

Sidebar

Related Questions

My silverlight app takes the user through a sort of wizard-like process, so for
I'm writing an user-driven app with several zones to it. I want to allow
I'm trying to write a faster user switching app for Windows. Win+L and selecting
I have a multi-user ASP.NET app running against SQL Server and want to have
I have an app that lets the user search over a number of fields
I let user enter some code in my Flex3 (Flash 10) app and I
I need to store the user's password in my iphone app. When posting an
I have an app which could benefit from the user being able to choose
My current app needs to store address information for a user. I'm currently debating
I am working on a android app and I have an EditText where user

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.