views:

131

answers:

2

We'd like to implement our own section index UI for UITableView.

It's clearly possible, since the contacts app does it on iPad. Is there a way of legally hiding the current section index? (I can get to the undocumented _index UIView but that's not going to cut it with Apple I suspect)

A: 

That answer helps.

The trick here is to have

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView;

return nil, while keeping implementations for the other section based data source methods:

- (NSInteger)numberOfSectionsInTableView:(UITableView *)tableView;
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
- (NSString *)tableView:(UITableView *)tableView titleForHeaderInSection:(NSInteger)section

That seems to convince the tableview not to display a section index, but still allow navigation by index.

Dan Bennett