title: Whole alphabet for sections index in core data
body: <p>I've implemented a table populated with core data and now I'm trying to indexing it with sections by displaying the side Alphabet (in Contacts like format).</p>
  
  <p>In the code below, if I use the commented line, I have only letters for existing sections. But I want the whole alphabet, and so I've changed the returned array:</p>
  
  <pre><code>- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
  {    
      //return [fetchedResultsController sectionIndexTitles];    
  
      indexArray = [NSArray arrayWithObjects: @"{search}", @"A", @"B", @"C", @"D", @"E", @"F", @"G", @"H", @"I", @"J",@"K", @"L", @"M", @"N", @"O", @"P", @"Q", @"R", @"S", @"T", @"U", @"V", @"W", @"X", @"Y", @"Z", @"#", nil];
      return indexArray;
  }
  </code></pre>
  
  <p>All the letters are displayed on the side index. But now I've to implement the method that returns the index of the selected section, and here I've some problems:</p>
  
  <pre><code>- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index
  {
      //return [fetchedResultsController sectionForSectionIndexTitle:title atIndex:index];
  
      NSString *correspondingLetter = [indexArray objectAtIndex:index];
      NSUInteger correspondingIndex = [[fetchedResultsController sections] indexOfObject:correspondingLetter];
  
      NSLog(@"------index:%i\ncorrespondingLetter: %@\ncorrespondingIndex: %i\n", index,correspondingLetter, correspondingIndex);
  
      return correspondingIndex;
  }
  </code></pre>
  
  <p>With the code above, if I use the commented line, I have an error each time I select a letter that doesn't have the corresponding section. So what I'm trying to do, is to retrieve the section index using the letter that has been selected and searching its position into existing sections. But it doesn't work.
  Do you have any ideas?</p>
  
  <p>Thanks in advance,
  yassa</p>