Reputation: 415
I have implemented around 10 tables on UIScrollView. I want to know which row of which UITable has been clicked.
thanks in advance.
Upvotes: 1
Views: 96
Reputation: 530
You can add tags to each of the table and then check it in didSelectRowAtIndexPath
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if(tableView.tag == 1){
//do something
}
else if(tableView.tag == 2){
//do something else
}
// and so on
}
Or else, you could check which instance of tableview is calling the delegate method:
- (void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath{
if(tableView == self.tableView1){
//do something
}
else if(tableView == self.tableView2){
//do something else
}
// and so on
}
Upvotes: 2