Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Localized index for UITableView

I'm trying to use a localized index for my UITableView same as iPhone's Contacts application . here is how I return an array of characters:

- (NSArray *)sectionIndexTitlesForTableView:(UITableView *)tableView
{
    return [[UILocalizedIndexedCollation currentCollation] sectionIndexTitles];
}

I changed the language setting to a non-English (Ex: Russian). However, it always returns an array of character in English:

|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|#

It is unlike the iPhone Contacts application which shows the index with merged Russian and English characters.

Is there anyway to get the localized array of characters?

like image 818
Mehrdad M Avatar asked May 25 '10 22:05

Mehrdad M


1 Answers

You can use CLDR's 'index characters' as I described here: C#: get letters of alphabet for scandinavian language?
That function probably does the same internally, or it wants to.

like image 137
Steven R. Loomis Avatar answered Sep 17 '22 14:09

Steven R. Loomis