嗨,我在一个视图中使用 2 个表,并且想要获取表的索引路径。我使用下面的代码来获取索引路径。但是无论我访问什么表,categoryId 都会受到影响,而不是其他东西。请帮忙...
-(void)tableView:(UITableView *)tableView didSelectRowAtIndexPath:(NSIndexPath *)indexPath
{
if(tableView=categoryTblView)
{
categoryId=indexPath.row;
NSLog(@"categoryId=%d",categoryId);
}
else if(tableView=regionTblView)
{
regionId=indexPath.row;
NSLog(@"regionId=%d",regionId);
}
}