本文介绍了[NSLocale preferredLanguages]和[[NSUserDefaults standardUserDefaults] objectForKey:@" AppleLanguages"]之间有什么区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

[NSLocale preferredLanguages] [[NSUserDefaults standardUserDefaults] objectForKey:@AppleLanguages]


  1. 我对Apple文档描述感到困惑,不明白,谁能告诉我他们的区别?因为我从他们那里获得了相同的数据。

  2. 我们应该在不同的情况下使用它们吗?


[NSLocale preferredLanguages] ,使用 [[NSUserDefaults standardUserDefaults] objectForKey:@AppleLanguages ] 如果您支持Mac OS X 10.4或更早版本。


What is the difference between [NSLocale preferredLanguages] and [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"]?

  1. I am confused with Apple Documentation description and can't understand clearly, Who can tell me their difference? because I get the same data from them.
  2. which one should we use at differente cases?
解决方案

You should use [NSLocale preferredLanguages], use [[NSUserDefaults standardUserDefaults] objectForKey:@"AppleLanguages"] if you are supporting Mac OS X 10.4 or earlier.

这篇关于[NSLocale preferredLanguages]和[[NSUserDefaults standardUserDefaults] objectForKey:@" AppleLanguages"]之间有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

09-18 07:39