title: How do I return an array with the initial letters of all the objects in another array?
body: <p>I am working on converting a plain tableview to a sectioned tableview.  I would like the section titles to be the first letter for the items in the section.</p>
  
  <p>This is what I have so far in my titleForHeaderInSection method:</p>
  
  <pre><code>NSSortDescriptor *sortDescriptor;
  sortDescriptor = [[[NSSortDescriptor alloc] initWithKey:@"Name"
                                                ascending:YES] autorelease];
  NSArray *sortedArray;
  NSMutableArray *commonNameArray = [tableDataSource valueForKey:@"Name"];
  
  NSArray *uniquearray;
  uniquearray = [[NSSet setWithArray:commonNameArray] allObjects];
  sortedArray = [uniquearray sortedArrayUsingSelector:@selector(caseInsensitiveCompare:)];
  </code></pre>
  
  <p>This code removes the duplicate titles and sorts the list alphabetically.  Now I just need to convert the strings in the array to the first letters only.  What is the best way to go about this?</p>