开发者

UILocalizedIndexedCollation only returns an English collation

开发者 https://www.devze.com 2023-03-11 16:50 出处:网络
I\'m trying to get a localized index like Contacts by using UILocalizedIndexedCollation. In Contacts when I change the language the index changes to match the 开发者_开发百科language. However sectionI

I'm trying to get a localized index like Contacts by using UILocalizedIndexedCollation. In Contacts when I change the language the index changes to match the 开发者_开发百科language. However sectionIndexTitles always returns an english index.

I have tried this with a demo app I created and with 3_SimpleIndexedTableView, which is a demo app from Apple and neither app have a localized index.

I have tried creating a localization folder for the current locale (I used [[NSLocale autoupdatingCurrentLocale] localeIdentifier] to determine the current locale). This does not affect the index.

I've had a look for relevant plist settings by found nothing.

Am I missing something or does UILocalizedIndexedCollation only return an English collation?


You can also set Localized resources can be mixed = YES in Info.plist. If the key is missing right click and choose Add Row.


Solved!

I didn't have a localization folder in my app bundle for the target language. I added sv.lproj (Swedish) and the collation worked as expected. The folder is empty, it's presence is all that's required for it to work.

0

精彩评论

暂无评论...
验证码 换一张
取 消