2

I have a footer in a grouped table that contains a UILabel I'd want to update according to the data in its section. I've noted that by calling [self.tableView reloadSections:[NSIndexSet indexSetWithIndex:0] withRowAnimation:NO]; calls not also viewForFooterInSection: but cellForRowAtIndexPath: as well. I don't want to reload the whole section, so I tried to call [self.tableView viewForFooterInSection:0], but it looks to be not possible get the footer that way.

How could I do this?

Thanks!

AppsDev
  • 12,319
  • 23
  • 93
  • 186
  • http://stackoverflow.com/a/1547591/1059705 – Bala Aug 06 '13 at 05:13
  • @Bala Thanks, but I do know that I can call to `reloadSections:` to refresh the footers, and my problem is that it seems to reload the whole section (headers, cells and footers)... – AppsDev Aug 06 '13 at 05:28
  • http://stackoverflow.com/a/4347686/1059705 this will help you for sure. – Bala Aug 06 '13 at 05:32
  • @Bala Thanks again, but I think this neither meets my needs... I'm gonna explain myself better: when my view loads, I have no footers in table. Cells in table are intended for users to enter some information, so I'd like to dynamically change the footers as the users provides her info. This `viewDidLoad` approach does not fit my scenario, I need to be able to change footers after the view has been loaded. – AppsDev Aug 06 '13 at 05:54
  • You should put your footer view in last cell of your section and reload this cell with reloadRowsAtIndexPaths:withRowAnimation:. This way you can dynamically change height and contents of your footer view. – Abid Hussain Aug 06 '13 at 07:19
  • `[self.tableView viewForFooterInSection:0]` works nicely. Use an empty footer when you setup your table, with a string made only of a single space `@" "` – dwery Feb 03 '15 at 19:36

0 Answers0