我刚开始使用 ios,我被困在UITableView.
我想在视图的右侧实现索引栏。我已经实现了这一点,但是当我点击索引栏上的部分时,它不起作用。
这是我的代码。这indexArray是“AZ”元素,finalArray是我的UITableView可变数组。
请告诉我应该在sectionForSectionIndexTitle.
- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView
{
return [finalArray count];
}
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection: (NSInteger)section
{
return [finalArray objectAtIndex:section];
}
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
return indexArray;
}
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle: (NSString *)title atIndex:(NSInteger)index
{
}