To add to the correct answer, if you want to reload all sections in your UITableView
you will need to do the following:
ObjC
NSRange range = NSMakeRange(0, [self numberOfSectionsInTableView:self.tableView]);
NSIndexSet *sections = [NSIndexSet indexSetWithIndexesInRange:range];
[self.tableView reloadSections:sections withRowAnimation:UITableViewRowAnimationAutomatic];
Swift
let range = NSMakeRange(0, self.tableView.numberOfSections)
let sections = NSIndexSet(indexesIn: range)
self.tableView.reloadSections(sections as IndexSet, with: .automatic)
This will reload everything in the table view with an animation. Like a boss.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…