All your UITableViewDelegate and UITableViewDatasource methods will be implemented only once. You just need to check in which table the method that is being called is displayed.
if (tableView == tblView1) { //Implementation for first tableView } else { //Implementation for second tableView }
this will work in all delegate methods of TableView and datasource, since tableView is a common parameter in all of your methods.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView {} - (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section {} - (UITableViewCell*)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath {} - (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath {}
Look here and here.
This link also has a solution to your problem.
Hope this helps
Kapil choubisa
source share