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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T05:48:01+00:00 2026-05-24T05:48:01+00:00

I have a simple UITableView with two sections. Each section has a header which

  • 0

I have a simple UITableView with two sections. Each section has a header which is displaying correctly.

In the second section, it’s header has a UIButton in it (as well as a UILabel) — the view for the section header is loaded from a xib — again, it views fine and the button reacts to tapping and calls my IBAction.

Each table cell in this section also has a button. When one of these buttons is tapped, I update the text in the button in the section header with a count. For background, each table cell represents a contact, and tapping the button in a given cell adds that contact to a list, and tapping the button in the section header will perform an action on all the contacts in the list.

Here is the crux — when the tableview first displays, tapping the button in cells correctly updates the section header button text right away. Once I scroll the table, even a little, and tap buttons, the section header button text no longer updates.

If I give the table a hard scroll up such that the section header bangs against the top or such, the section header button label suddenly updates, as if redraw events have been queued up and suddenly are released.

I’ve tried performing the update on the main thread, in an async dispatch block, calling setNeedsDisplay/Layout, etc. It refuses to update unless I wack the table around.

Calling reloadData on the table after updating the button text works, but that seems awful heavy handed.

Thanks for any insights…

The code updating the button text:

   NSString *l = NSLocalizedString(@"INVITE_LABEL", nil);
   NSString *label = [NSString stringWithFormat:l, [invitedEmails count]];
   [inviteSelectedButton setTitle:label forState:UIControlStateNormal];

Calling that from the IBAction of a table view button tap event. If I suffix that code with:

   [self.viewController.addressBookTable reloadData];

the code above it works right away every time.

  • 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-24T05:48:02+00:00Added an answer on May 24, 2026 at 5:48 am

    I’ve had similar issues before with buttons inside of table views – cells or headers. In my case it was always a situation where even though I believed I was correctly targeting the desired Button View, with scrolling or table reloads, the button was actually being replaced with a new instance. Without going into too much detail, my solution was to create a custom button that subclassed UIButton and responded appropriately to my actions by calling methods directly on the (id)sender or by posting UINotifications.

    I’m not sure if this will help you with your problem, but perhaps it will trigger a solution.

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

Sidebar

Related Questions

I have set up a UITableView which has 3 sections in, with 3 rows
I have a uitableview 'A' which has cells, on clicking one of the cell,
I have very simple iPhone app, which uses just UIButtons , UIlabels , UITableView
I have a setup with sections in a UITableView which all have a custom
Currently I have UITableView and simple UIView in my iPad application. Each of them
Ok, i have simple scenario: have two pages: login and welcome pages. im using
Given the section of an application which has a UINavigationController and 2 levels of
I have two custom objects, Phrase Book and Phrase, the Phrase Book has an
I have a fairly simple iPhone app that downloads a set of UITableView results
In a simple UITableView I have: - (void)viewDidLoad { NSArray *array = [[NSArray alloc]initWithObjects:@Pictures,@Video,@Text,@Map,nil];

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.