NSLocale
NSLocale 表示区域信息,常用于 NSDateFormatter、NSNumberFormatter 等格式化组件。
类成员 (Class members)
Section titled “类成员 (Class members)”currentLocale
Section titled “currentLocale”当前用户区域。
static currentLocale(): NSLocaleReturn Value:
NSLocale: 当前区域实例。
systemLocale
Section titled “systemLocale”系统区域。
static systemLocale(): NSLocaleReturn Value:
NSLocale: 系统区域实例。
localeWithLocaleIdentifier
Section titled “localeWithLocaleIdentifier”从区域标识创建。
static localeWithLocaleIdentifier(identifier: string): NSLocaleParameters:
| Name | Type | Description |
|---|---|---|
identifier | string | 区域标识(如 “zh_CN”)。 |
Return Value:
NSLocale: 新区域实例。
实例成员 (Instance members)
Section titled “实例成员 (Instance members)”localeIdentifier
Section titled “localeIdentifier”区域标识字符串。
localeIdentifier(): stringReturn Value:
string: 区域标识。
objectForKey
Section titled “objectForKey”按 key 取区域属性。
objectForKey(key: any): anyParameters:
| Name | Type | Description |
|---|---|---|
key | any | 属性 key。 |
Return Value:
any: 属性值。