Become a MacRumors Supporter for $50/year with no ads, ability to filter front page stories, and private forums.

SamiGh

macrumors newbie
Original poster
Mar 10, 2010
3
0
Hey,

I have a problem with localizing the indexes that appear on the right of a UITableView. I need the letters of these indexes to appear according to the used language in the iPhone. After searching I found that i have to use the following NSArray:
Code:
[[UILocalizedIndexedCollation currentCollation] sectionIndexTitles];

When I tested it, I found out that it always gives English characters no matter what the used language is. But in the Contacts application, Both English and the default language characters appear on the right of the table.

I appreciate any help concerning this subject

Best regards

Sami
 
I assume you are localizing to specific languages. Why don't you add your list of letters to each localization?
 
Thanks for the reply,
I don't think that will work with the application. I am localizing it into two languages, but the data that is viewed in the table might be in any language. In the case of a different language, i'll end up with all the entries under the hash sign section.
Does the contacts application follow this method?
 
I don't entirely understand the use of the hash sign in Contacts.

Either you're getting the characters to display in the index from the language you're displaying or you're getting the characters from the data you're displaying, or both I suppose.
 
Since you cannot force the data to start with a letter rather than a number or a symbol, you have to use the hash sign. I agree with you that there is no point of using it in Contacts application but some people replace letters with symbols such as: $am, or numbers. :S

Till now, I get the characters from the language I am displaying rather than the data because there might be some letters that are missing in the data. I do that using the currentCollation that I referred to it in my first post, but it always returns english alphabetic. I have no idea why.
In case there is no straight forward solution to achieve that, I think I will stick with your first suggestion to add it to localization.

Thanks a lot :D
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.