views:

1619

answers:

2

In the iPhone music app, selecting Artist, Songs, or Albums presents a tableView with a verticl list of single letters at the righthand side of the UI that enables rapid scrolling. How do I enable this functionality in my app?

Cheers, Doug

+1  A: 

Implement the delegate methods -sectionIndexTitlesForTableView: and -tableView:sectionForSectionIndexTitle:atIndex:

See the UITableViewDataSource documentation for more info.

Alex Reynolds
Cheers Alex, will do.
dugla
+7  A: 

Supply your own index characters:

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView {
    return[NSArray arrayWithObjects:@"a", @"e", @"i", @"m", @"p", nil];
}

and then:

- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString
    *)title atIndex:(NSInteger)index {
        return <yourSectionIndexForTheSectionForSectionIndexTitle >;
}

You will need sections.

zaph
Easy peasy. Cool beans zaph. Cheers.
dugla