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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T21:23:54+00:00 2026-05-23T21:23:54+00:00

I have a UITableView with each cell containing the following 1) A UILabel (listing

  • 0

I have a UITableView with each cell containing the following

1) A UILabel (listing the names of people who clicked on the button)

2) A button (when clicked will add the clicker’s name to the list displayed in UILabel)

The button is an instance of a subclass of UIControl. So the intention is that when the button is clicked, I will add the current user to the array used by the UILabel for display.

However, I am unsure how I can reload the parent cell (in which the button is contained)

Just to re-iterate my issue

1) The addition of user name to list is done in the button subclass and not the UITableViewCell, how can I call the parent cell once I have updated the array?

2) I do not want to reload the entire table, just the specific cell in which the user has clicked the button.

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-23T21:23:55+00:00Added an answer on May 23, 2026 at 9:23 pm

    Write an action method in the view controller which is the table view datasource, like :

    -(IBAction)reloadCell:(id)theCell {
       NSIndexPath *idxPath = [theTableView indexPathForCell:theCell];
       [theTableView reloadRowsAtIndexPaths:[NSArray arrayWithObjects:idxPath, nil]
                            withRowAnimation:YES]; // or NO ;)
    }
    

    Then in the -(UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath; method, before returning the cell, configure it like so :

    // ...
    [cell.theButton addTarget:self
                       action:@selector(reloadCell:)
             forControlEvents:UIControlEventTouchUpInside];
    return cell;
    

    This will make the -(IBAction)reloadCell:(id)sender; method called when touching the button, and reloading the particular cell, but this solution will maybe make you move the code that updates the content of the list, as I don’t know which of the messages will be sent first (the one updates the content, or the one that reloads the cell).

    So the best way I think is, for your custom button subclass to have a weak reference to the controller, so the button could update the content, and then send a message to the controller, and is working based on the same action method in the controller.

    In your button subclass .h

    YourControllerType *tableController;
    
    @property(assign) YourControllerType *tableController;
    

    In your button subclass .m

    @synthesize tableController
    
    // in the method where you update the list
    [tableController reloadCell:self.superview];
    

    Also don’t forget to configure correctly the cell

    // ...
    cell.theButton.tableController = self;
    return cell;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Basically I want to re-style UITableView(Controller). Each cell will have a picture as a
I have a UITableView and each cell contains a Map button. When I tap
I have to add one image, one label and one button in each cell.
I have a UITableView with custom cells. The cells containing one UITextView each and
I have a table containing images and buttons. Each button has a tag with
I have a UITableView where each cell is an image. Only one cell is
I have a UITableView that has about 20 cells. Each has a UILabel within,
I have a UITableView with custom cells. Inside each cell is 2 views. Each
So I have my UITableView, with 2 sections and 1 cell in each, and
I have tableview with some names on each cell , how can i get

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.