是两个协议方法
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
if (tableView == self.tableView) {
return self.firstArray;
}
return nil;
}
返回的是点击的哪个位置
-(NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index {
NSLog(@"%ld", index);
// [self.tableView scrollToRowAtIndexPath:[NSIndexPath indexPathForItem:0 inSection:index + 2] atScrollPosition:UITableViewScrollPositionTop animated:NO];
return index + 2;
}