Method - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section is the protocol method of the UITableViewDataSource protocol. It will be called the first time your table view is loaded based on the fact that you have correctly set dataSource , for example.
self.yourTableView.dataSource = self;
If you want to update the table again, you can call
[self.yourTableView reloadData]
to reload the entire table. If you are only interested in reloading part of the table, you can do something similar to
NSIndexSet *reloadSet = [NSIndexSet indexSetWithIndexesInRange:NSMakeRange(0, [self numberOfSectionsInTableView:self.yourTableView])]; [self.yourTableView reloadSections:reloadSet withRowAnimation:UITableViewRowAnimationAutomatic];
Hope this helps!
source share