NSSortDescriptor in Chinese… how?

拈花ヽ惹草 提交于 2019-12-08 10:36:22

问题


I am adding Chinese support to my application.

I have this line that sorts english and other languages

    NSSortDescriptor *sortByItem =  [NSSortDescriptor sortDescriptorWithKey:@"countryName" ascending:YES 
selector:@selector(localizedStandardCompare:)];

But this line appears not to be sorting in Chinese.

How do I modify this line so it will sort in Chinese?


回答1:


Your assumption that NSSortDescriptor is wrong and Numbers is correct is not a good assumption. It depends on what locale you used in each case (was your iOS device in a Chinese locale? Was your Mac?) Chinese is generally sorted by radical+stroke, but you need a little experience to know how to break characters down into this form. I would frankly trust NSSortDescriptor first in any case. Numbers is hardly the gold standard in such things.

Your best bet if you're working on localizing is to engage a service that specializes in that to help you. If you don't have enough experience in the language to know if you're sorting correctly, then it's hard to imagine getting the rest correct.



来源:https://stackoverflow.com/questions/29868944/nssortdescriptor-in-chinese-how

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!