Hi All,
I am trying to get to grips with adding an index to a tableview, just like the one in contacts. I am confident in setting up the tableview, controls and UI settings, and generally all is going well. Except I can't figure out what I'm missing here. The app builds fine, with no errors, and it appears fine in the iPhone simulator. It just doesn't have the index down the side.
This is the code I'm using. This is in the delegate.m file, which I think is the right place for it. 'entries' is the NSMutableArray I have of the data list.
Any comments or advice would be most appreciated. If anyone has a really simple example I can review, that would be wonderful.
[I have been using the simple index example from the Apple site, but can't see the wood for the trees.]
I am trying to get to grips with adding an index to a tableview, just like the one in contacts. I am confident in setting up the tableview, controls and UI settings, and generally all is going well. Except I can't figure out what I'm missing here. The app builds fine, with no errors, and it appears fine in the iPhone simulator. It just doesn't have the index down the side.
This is the code I'm using. This is in the delegate.m file, which I think is the right place for it. 'entries' is the NSMutableArray I have of the data list.
- (NSArray *)sectionIndexTitlesForTableViewUITableView *)tableView {
return [entries valueForKey"letter"];
}
- (NSInteger)tableViewUITableView *)tableView sectionForSectionIndexTitleNSString *)title atIndexNSInteger)index {
return [entries indexOfObject:title];
}
return [entries valueForKey"letter"];
}
- (NSInteger)tableViewUITableView *)tableView sectionForSectionIndexTitleNSString *)title atIndexNSInteger)index {
return [entries indexOfObject:title];
}
Any comments or advice would be most appreciated. If anyone has a really simple example I can review, that would be wonderful.
[I have been using the simple index example from the Apple site, but can't see the wood for the trees.]