今天发现UITableView右边索引的点击无效,然后一阵忙碌检查原因,百度google后依然没有发现问题。
最后反复检查对比代码,发现原来是右边索引重复问题,直接上问题代码
-(NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView{
return sectionTitles;
}
因为我们这个页面有两个UITableView,第二个UITableView是处于隐藏状态,没有右边索引栏的。
-(NSArray *)sectionIndexTitlesForTableView:(UITableView*)tableView{
if(tableView == myTableView) {
return myInfoArray;
}
return nil;
}
这样修改就好了。
网友评论