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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T09:51:21+00:00 2026-05-25T09:51:21+00:00

I have found an example that I am trying to wrap my head around,

  • 0

I have found an example that I am trying to wrap my head around, I have a subview thats loading values from my online resource into the section of uitableview cells.. everything is working sweet however now I want to capture the cell selection and pass that data back to the parent view cell that was selected. I think this example is what i need to get it working but I am struggling to understand what some of the variables are for in the example and am hoping someone can help me understand it abit better.

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {
    // do usual stuff here including getting the cell

    // determine the data from the IndexPath.row

    if (data == self.checkedData)
    {
        cell.accessoryType = UITableViewCellAccessoryCheckmark;
    } else {
        cell.accessoryType = UITableViewCellAccessoryNone;
    }

    return cell;
}

- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {
    // determine the selected data from the IndexPath.row

    if (data != self.checkedData) {
       self.checkedData = data;
    }

    [tableView reloadData];
}

my main concerns are with data and self.checkedData is data the data coming back from the array of values that have been parsed? and what is checkedData? basically I want to have those check marks at the end of the cell when selected.

  • 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-25T09:51:22+00:00Added an answer on May 25, 2026 at 9:51 am

    I might be wrong considering there is no much context with that few lines of code but I’ll give it a try.

    First of all, it looks like you can have only one cell checked at a time.

    Data seems to be the current cell and checkedData a way to keep track of which cell will get the checkmark.

    Whenever a cell is selected it’s marked:

    if (data != self.checkedData) {
       self.checkedData = data;
    }
    

    And the controller asks the TableView to redraw (i.e. reload) itself again:

    [tableView reloadData];
    

    When that action is fired-up, the delegate calls tableView:cellForRowAtIndexPath: (amongst other methods) and if you are the selected cell you get a checkmark:

    if (data == self.checkedData)
    {
        cell.accessoryType = UITableViewCellAccessoryCheckmark;
    } 
    

    Otherwise, you don’t:

    else {
        cell.accessoryType = UITableViewCellAccessoryNone;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to run the following recognizer intent example that i have found
I'm trying to wrap my head around closures, and I think I've found a
I have found that the Windows VK_OEM_X values have a tendency to refer to
I have a web-app, that I'm trying to wrap as a native app. I'm
I am trying to use WPF printing from PowerShell. I have found a simple
I have been trying to find a collision avoidance example that I can adapt
I'm trying to wrap my head around something; maybe someone here can point me
I've been trying to wrap my head around how sockets work, and I've been
I am trying to wrap my head around a Linq query to return a
I have found many sites that describes PRG, but no simple PHP code example.

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.