UILocalizedIndexedCollat​​ion仅返回英语排序规则 [英] UILocalizedIndexedCollation only returns an English collation

查看:56
本文介绍了UILocalizedIndexedCollat​​ion仅返回英语排序规则的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用UILocalizedIndexedCollation获取本地化的索引,例如联系人".在联系人"中,当我更改语言时,索引也会更改以匹配该语言.但是,sectionIndexTitles始终返回英文索引.

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.

我已经使用我创建的演示应用程序和3_SimpleIndexedTableView进行了尝试,这是Apple的演示应用程序,两个应用程序都没有本地化索引.

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.

我尝试为当前语言环境创建一个本地化文件夹(我使用[[NSLocale autoupdatingCurrentLocale] localeIdentifier]确定当前语言环境).这不会影响索引.

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.

我一无所获,寻找了相关的plist设置.

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

我错过了什么吗?或者UILocalizedIndexedCollation只返回英语排序规则吗?

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

推荐答案

已解决!

我的应用程序捆绑包中没有目标语言的本地化文件夹.我添加了sv.lproj(瑞典语),并且整理工作按预期进行.该文件夹是空的,只有它存在才能正常工作.

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.

这篇关于UILocalizedIndexedCollat​​ion仅返回英语排序规则的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆