NSString isEqualToString:不等于韩语。
开发基于 iOS5 的 cocoa 应用程序,如果本地化是英语,下面的比较工作正常,但如果本地化是韩语,则失败。
//title is of type NSString
if([title isEqualToString:NSLocalizedString(@"Power",@"Power")])
韩语标题和本地化字符串明显相同。
isEqualToString:
与韩语/unicode 字符串不匹配吗?
Developing iOS5 based cocoa app, below peice of comparison works fine if localization is English, but fails if localization is Korean.
//title is of type NSString
if([title isEqualToString:NSLocalizedString(@"Power",@"Power")])
in korean title and localized string is same visibly.
does isEqualToString:
doesnot match Korean/unicode strings?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
只是一个猜测。
我认为它在英语中不起作用,但由于您在
NSLocalizedString()
中使用英语单词,因此应用程序默认使用它们,这就是让您认为它有效的原因。问题应该出在其他地方。
检查 : 是否
返回韩语翻译。
Just a guess.
I assume that it does not work in English to, but since you are using the english words in your
NSLocalizedString()
the app uses them is default and that's what make you think it works.The problem should be elsewhere.
Check if :
returns the korean translation.
使用 NSString 的本地化比较方法可能会获得更好的结果:
-localizedCaseInsensitiveCompare:
、-localizedCompare:
或-localizedStandardCompare:
。You might get better results using NSString's localized comparison methods:
-localizedCaseInsensitiveCompare:
,-localizedCompare:
, or-localizedStandardCompare:
.