Store the section title in a property in your UIViewController
, or whatever class is acting as your UITableViewDelegate
.
@property (nonatomic,strong) NSString *sectionTitle;
And set its value to @"hello"
somewhere.
Then when in your button press method, update self.sectionTitle with the new title.
self.sectionTitle = @"hi";
Then reload your entire UITableView or reload the appropriate section.
[tableView reloadData]; // Entire
Or
NSIndexSet *sectionIndex = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, 1)];
[self.tableView reloadSections:section withRowAnimation: UITableViewRowAnimationAutomatic];
// Specific section