Skip to content

Instantly share code, notes, and snippets.

@frr149
Created August 27, 2013 10:32
Show Gist options
  • Save frr149/6351981 to your computer and use it in GitHub Desktop.
Save frr149/6351981 to your computer and use it in GitHub Desktop.
- (NSInteger)tableView:(UITableView *)tableView
sectionForSectionIndexTitle:(NSString *)title
atIndex:(NSInteger)index{
NSLog(@"Touched on section %@", title);
NSInteger firstStartingWithLetter = 0;
// búsqueda de la primera familia cuyo nombre empieza
// por la letra tocada
for (NSString *familyName in self.familyNames) {
if ([[familyName substringToIndex:1] isEqualToString:title]) {
firstStartingWithLetter = [self.familyNames indexOfObject:familyName];
}
}
return firstStartingWithLetter;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment