您好,只是一个简单的问题,在 NSLocale 类中 – displayNameForKey:value: 和 – objectForKey: 有什么区别?我在网上搜索但没有得到它。谢谢你。
displayNameForKey:value:
Returns the display name for the given value.
- (NSString *)displayNameForKey:(id)key value:(id)value
Parameters
key
Specifies which of the locale property keys value is (see “Constants”),
value
A value for key.
Return Value
The display name for value.
objectForKey:
Returns the object corresponding to the specified key.
- (id)objectForKey:(id)key
Parameters
key
The key for which to return the corresponding value. For valid values of key, see “Constants.”
Return Value
The object corresponding to key.