gpt4 book ai didi

ios - UILocalizedIndexedCollat​​ion 区域设置不同于英语

转载 作者:行者123 更新时间:2023-11-29 10:59:08 25 4
gpt4 key购买 nike

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

当我点击说字符“S”时,我遇到了问题,它显示的是“R”部分而不是“S”,即使“S”中有条目。同样对于最后一个字符“å”、“ä”,它分别将我带到 X 和 Y,尽管 LocalizedIndexedCollat​​ion 中没有“X”。

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

在这方面的任何帮助都会很棒。

谢谢。

最佳答案

与 iOS7 GM 的韩语相同。

我也检查了日语,但没有我们面临的问题。
日语和韩语的区别在于顺序( link )

在韩语中,韩语出现在英语之前。
但是在日语中,我测试时英语出现在日语之前。

当我检查这个方法时,

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

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

  • sectionForSectionIndexTitleAtIndex 增加 4 ("A"+ 1 - "F"),当 "ㄴ"-> "ㄷ"时(索引只增加 1)。
  • sectionForSectionIndexTitleAtIndex 重复递增。 1, 4, 1, 4 ...

我对这个问题的结论是 iOS7 在 Unicode 中的 ASCII 顺序错误。
因此,我将临时修改 tableView:sectionForSectionIndexTitle:atIndex 方法,使其按预期工作。

关于ios - UILocalizedIndexedCollat​​ion 区域设置不同于英语,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/16832164/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com