表头显示关键字
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section
{
NSArray* Keys = [[addressBookDic allKeys] sortedArrayUsingSelector:@selector(compare:)];
return [Keys objectAtIndex:section];
}
右边显示关键字母
-(NSArray*)sectionIndexTitlesForTableView:(UITableView*)tableView
{
return [[addressBookDic allKeys] sortedArrayUsingSelector:@selector(compare:)];
}
本文介绍如何在iOS应用中实现表格视图的表头显示关键字和右侧显示关键字母的功能,通过自定义表格头部和使用sortedArrayUsingSelector方法对数据进行排序。
238

被折叠的 条评论
为什么被折叠?



