UILocalizedIndexedCollat​​ion语言环境与英语不同 [英] UILocalizedIndexedCollation locale different than English

查看:90
本文介绍了UILocalizedIndexedCollat​​ion语言环境与英语不同的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在使用带有UILocalizedIndexedCollat​​ion的Tableview在右侧显示索引,但是我手机上的语言是瑞典语(svenska),因此我在A-Z之后看到一些特定于瑞典语的特殊字符,例如åäö.在A-Z中,有些字符缺失,例如Q,X等,我相信在Sweidsh语言环境中是不存在的.

I am using Tableview with UILocalizedIndexedCollation to show the index on right side but the language on my phone is Swedish (svenska) hence I see some special characters specific to Swedish language like å ä ö after A-Z . In A-Z some of the characters are missing like Q, X etc which I believe are not there in Sweidsh locale.

单击"S"字符时,我遇到问题,即使在"S"中有条目,它也会显示"R"部分而不是"S".同样,对于最后一个字符å",ä",我也分别将我带到X和Y,尽管LocalizedIndexedCollat​​ion中没有"X".

I am facing issue when I click say character "S" , it shows me section "R" instead of "S" even though there are entries in "S" . Also for last characters "å", "ä" it takes me to X and Y respectively , although there is no "X" in the LocalizedIndexedCollation.

我也遵循了本教程 http://benedictcohen.co.uk/blog/archives/230 ,但没有解决我的问题.

I followed this tutorial too http://benedictcohen.co.uk/blog/archives/230 but it did not fixed my issue.

任何对此的帮助都会很棒.

Any help on this would be great.

谢谢.

推荐答案

与iOS7 GM的韩语相同.

Same in Korean with iOS7 GM.

我也检查过日语,但是我们没有遇到问题.
日语和韩语之间的区别是排序(链接)

I checked Japanese either, but there isn't the problem we facing.
The difference between Japanese and Korean is the ordering(link)

在朝鲜语中,朝鲜语出现在英语之前.
但是在日语中,当我进行测试时,英语出现在日语之前.

In Korean, Korean occurs before English.
But in Japanese, English occurs before Japanese when I tested.

当我检查此方法时,

- (NSInteger)tableView:(UITableView *)tableView sectionForSectionIndexTitle:(NSString *)title atIndex:(NSInteger)index
{
    NSLog(@"%i", index);
    NSLog(@"%i", [[UILocalizedIndexedCollation currentCollation] sectionForSectionIndexTitleAtIndex:index]);
}

我可以注意到sectionForSectionIndexTitleAtIndex根据给定的索引异常增加.

I can notice sectionForSectionIndexTitleAtIndex increasing in accordance with given index abnormally.

  • sectionForSectionIndexTitleAtIndex增加4("A" + 1-"F"),当ㄴ"->ㄷ"(索引增加1).
  • sectionForSectionIndexTitleAtIndex的增量正在重复. 1,4,1,4 ...

关于这个问题的结论是,iOS7的Unicode Unicode排序错误.
因此,我将临时修改tableView:sectionForSectionIndexTitle:atIndex方法按预期工作.

My conclusion about this problem is that iOS7 bug in Unicode with ASCII ordering.
So, I will temporarily modify tableView:sectionForSectionIndexTitle:atIndex method works as I intended.

这篇关于UILocalizedIndexedCollat​​ion语言环境与英语不同的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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