title: Cocoa method to return a list of all letters in the current locale's alphabet?
body: <p>I'm currently trying to implement a <a href="http://developer.apple.com/iphone/library/documentation/uikit/reference/UITableView_Class/Reference/Reference.html" rel="noreferrer"><code>UITableView</code></a> with a <a href="http://developer.apple.com/iphone/library/documentation/uikit/reference/UITableViewDelegate_Protocol/Reference/Reference.html" rel="noreferrer">delegate</a> and <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableViewDatasource_Protocol/Reference/Reference.html" rel="noreferrer">data source</a> that replicates, as closely as possible, the functionality found the <a href="http://developer.apple.com/iphone/library/documentation/AddressBookUI/Reference/AddressBookUI_Framework/index.html" rel="noreferrer"><code>ABAddressBookUI</code></a> framework's <a href="http://developer.apple.com/iphone/library/documentation/AddressBookUI/Reference/ABPeoplePickerNavigationController_Class/Reference/Reference.html" rel="noreferrer"><code>ABPeoplePickerNavigationController</code></a> class, but with the added ability to select multiple contacts at once (as indicated by adding/removing an accessory view to the appropriate <a href="http://developer.apple.com/iphone/library/documentation/uikit/reference/UITableViewCell_Class/Reference/Reference.html" rel="noreferrer"><code>UITableViewCell</code></a>).</p>
  
  <p>Everything is working fine, with the exception of providing localized "section index titles" (the letters that appear in the scroll overlay to the right of the screen) for the <a href="http://developer.apple.com/iphone/library/documentation/uikit/reference/UITableView_Class/Reference/Reference.html" rel="noreferrer"><code>UITableView</code></a>, as should be returned by the <a href="http://developer.apple.com/iphone/library/documentation/UIKit/Reference/UITableViewDatasource_Protocol/Reference/Reference.html#//apple_ref/occ/intfm/UITableViewDataSource/sectionIndexTitlesForTableView:" rel="noreferrer">data source</a> method:</p>
  
  <blockquote>
    <p><code>- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView</code></p>
  </blockquote>
  
  <p>Obviously, I could just return an <a href="http://developer.apple.com/iphone/library/documentation/cocoa/Reference/Foundation/Classes/NSArray_Class/NSArray.html" rel="noreferrer"><code>NSArray</code></a> containing the <a href="http://developer.apple.com/iphone/library/documentation/cocoa/reference/foundation/Classes/NSString_Class/Reference/NSString.html" rel="noreferrer"><code>NSStrings</code></a> A, B, C ...Z, but I'd ideally like this method to return an array of all of the (uppercase, where applicable) letters of the alphabet <strong>of the current locale</strong>.</p>
  
  <p>One promising lead was:</p>
  
  <blockquote>
    <p><code>[[</code><a href="http://developer.apple.com/iphone/library/documentation/cocoa/reference/Foundation/Classes/NSLocale_Class/Reference/Reference.html" rel="noreferrer"><code>NSLocale</code></a><code>currentLocale ] objectForKey:@"NSLocaleExemplarCharacterSet" ]</code></p>
  </blockquote>
  
  <p>But I can't find any significant documentation on this and it returns an <a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSCharacterSet_Class/Reference/Reference.html" rel="noreferrer"><code>NSCharacterSet</code></a>, from which I've been unable to extract the actual characters (if I could do that, then NSCharacterSet's <a href="http://developer.apple.com/mac/library/documentation/Cocoa/Reference/Foundation/Classes/NSCharacterSet_Class/Reference/Reference.html#//apple_ref/occ/clm/NSCharacterSet/capitalizedLetterCharacterSet" rel="noreferrer"><code>capitalizedLetterCharacterSet</code></a> could also be a promising starting point).</p>
  
  <p>I've also run an <a href="http://developer.apple.com/mac/library/documentation/Darwin/Reference/ManPages/man1/otool.1.html" rel="noreferrer"><code>otool -tV</code></a> on the <a href="http://developer.apple.com/iphone/library/documentation/addressbookui/reference/addressbookui_framework/index.html" rel="noreferrer"><code>AddressBookUI</code></a> framework, which revealed a call to the function <code>ABAddressBookCopySectionIndices()</code>, into which an <a href="http://developer.apple.com/iphone/library/documentation/AddressBook/Reference/ABAddressBookRef_iPhoneOS/Reference/reference.html" rel="noreferrer"><code>ABAddressBookRef</code></a> can be passed to obtain exactly what I'm looking for… a CFArray of the localized alphabet. <em>However</em>, it's a private function, so I can't use it in my app.</p>
  
  <p>So, does anybody know whether Cocoa Touch supports this functionality? And, if not, are there any ideas as to how <code>ABAddressBookCopyIndices()</code> is working its magic? I suspect the <a href="http://site.icu-project.org/" rel="noreferrer">International Components for Unicode</a> library may well hold the key, but I'm not (as yet) familiar with its capabilities...</p>