今天發(fā)現(xiàn)UITableView右邊索引的點擊無效,然后一陣忙碌檢查原因,百度google后依然沒有發(fā)現(xiàn)問題赦政。
最后反復(fù)檢查對比代碼粱甫,發(fā)現(xiàn)原來是右邊索引重復(fù)問題泳叠,直接上問題代碼
-(NSArray<NSString *> *)sectionIndexTitlesForTableView:(UITableView *)tableView{
? ? return sectionTitles;
}
因為我們這個頁面有兩個UITableView,第二個UITableView是處于隱藏狀態(tài)茶宵,沒有右邊索引欄的危纫。
-(NSArray *)sectionIndexTitlesForTableView:(UITableView*)tableView{
? ? if(tableView == myTableView) {
? ? ? ? return myInfoArray;
? ? }
? ? return nil;
}
這樣修改就好了。