Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

beachdog

macrumors member
Original poster
Aug 10, 2008
86
0
The UITableView reference says "A table view can have an index that appears as a bar on the right hand side of the table (for example, "a" through "z")", which is exactly what I want. But I don't see how to do it. Can someone offer some pointers on this?
 

Taum

macrumors member
Jul 28, 2008
56
0
Hi,

Your datasource should implement sectionIndexTitlesForTableView:
 

Garrett

macrumors regular
Apr 4, 2007
173
0
The UITableView reference says "A table view can have an index that appears as a bar on the right hand side of the table (for example, "a" through "z")", which is exactly what I want. But I don't see how to do it. Can someone offer some pointers on this?

Here is the documentation from the UITableView.h file

Code:
- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView; // return list of section titles to display in section index view (e.g. "ABCD...Z#")
- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index;  // tell table which section corresponds to section title/index (e.g. "B",1))

You just simply give it an array of data (which you would use for your table anyways). I am not sure how to implement images though :rolleyes:
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.