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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T13:53:52+00:00 2026-06-10T13:53:52+00:00

How do I observe cell accessory Type UITableViewCellAccessoryCheckmark is checked or not? In my

  • 0

How do I observe cell accessory Type UITableViewCellAccessoryCheckmark is checked or not?

In my app I added UITableView in a UIAlertView. I also used

cell.accessoryType = UITableViewCellAccessoryCheckmark;

In my tableView, i have 9 rows. When the user taps on first row then all rows become checked except second row. The user can check any row/rows as he wishes. When the user taps on the second row then only the second row is checked.

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-06-10T13:53:54+00:00Added an answer on June 10, 2026 at 1:53 pm

    While the answer of @dasblinkenlight is certainly more elegant, it might be too advanced for you.

    The essence is to keep track of which cells are checked and which are unchecked. Whenever something changes, reload the table view to updated the checkmarks.

    You need to create your own variable to track this. A bitmap is very economical and elegant, but it might be difficult to understand and not scalable to a large number of rows. Alternatively, you could use an array.

    NSMutableArray *checkedArray = [NSMutableArray arrayWithObjects:
                       [NSNumber numberWithBool:YES],
                       [NSNumber numberWithBool:NO],
                       [NSNumber numberWithBool:NO],
                       [NSNumber numberWithBool:NO],
                       [NSNumber numberWithBool:NO],
                       [NSNumber numberWithBool:NO],
                       [NSNumber numberWithBool:NO],
                       [NSNumber numberWithBool:NO],
                       [NSNumber numberWithBool:NO],
                       nil];
    

    To change a row given the index path:

    [checkedArray replaceObjectAtIndex:indexPath.row 
                            withObject:[NSNumber numberWithBool:YES]]; //add
    
    [checkedArray replaceObjectAtIndex:indexPath.row 
                            withObject:[NSNumber numberWithBool:NO]]; //remove
    

    And in cellForRowAtIndexPath make sure you set the accessory explicitly:

    if ([[checkedArray objectAtIndex:indexPath.row] boolValue]) {
        cell.accessoryType = UITableViewCellAccessoryTypeCheckmark;
    } 
    else {
        cell.accessoryType = UITableViewCellAccessoryTypeNone;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have subclassed a tableview cell and added a couple of labels and images
I want to put some background image for TableView row cell. I am using
Observe that the jQuery UI CSS does not pass validation. I try to adhere
Observe the following trivial anonymous type in C# new { X = 5 };
Observe the following .NET type: public class X { public DateTime Timestamp {get;set;} public
I regularly observe obsolete classes and methods in Java API. I did not find
I have a UITableView populated by a SQLite database. I added Section-based Grouping using
I want to observe other field blur event. Suppose I have: <input type=text name=age
i have one tableview that have custom cells and one cell contains uiimageview,uilabels .
Please observe the following markup: <Style TargetType={x:Type MenuItem} x:Key=...> <Setter Property=HeaderTemplate> <Setter.Value> <DataTemplate> <ContentPresenter

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.