NSKeyedUnarchiver
NSKeyedUnarchiver 用于从归档数据(NSData)或文件中还原对象图。
类成员 (Class members)
Section titled “类成员 (Class members)”unarchiveObjectWithData
Section titled “unarchiveObjectWithData”从 NSData 反归档根对象。
static unarchiveObjectWithData(data: NSData): anyParameters:
| Name | Type | Description |
|---|---|---|
data | NSData | 归档数据。 |
Return Value:
any: 根对象。
unarchiveObjectWithFile
Section titled “unarchiveObjectWithFile”从文件反归档根对象。
static unarchiveObjectWithFile(path: string): anyParameters:
| Name | Type | Description |
|---|---|---|
path | string | 文件路径。 |
Return Value:
any: 根对象。
setClassForClassName
Section titled “setClassForClassName”设置类名映射(反归档用)。
static setClassForClassName(cls: any, codedName: string): voidParameters:
| Name | Type | Description |
|---|---|---|
cls | any | 实际类。 |
codedName | string | 归档中的类名。 |
Return Value:
- 无。
classForClassName
Section titled “classForClassName”取归档名对应的类。
static classForClassName(codedName: string): anyParameters:
| Name | Type | Description |
|---|---|---|
codedName | string | 归档类名。 |
Return Value:
any: 类。
实例成员 (Instance members)
Section titled “实例成员 (Instance members)”initForReadingWithData
Section titled “initForReadingWithData”用数据初始化(用于增量解码)。
initForReadingWithData(data: NSData): voidParameters:
| Name | Type | Description |
|---|---|---|
data | NSData | 归档数据。 |
Return Value:
- 无。
setDelegate
Section titled “setDelegate”设置委托。
setDelegate(delegate: any): voidParameters:
| Name | Type | Description |
|---|---|---|
delegate | any | 委托对象。 |
Return Value:
- 无。
delegate
Section titled “delegate”委托。
delegate(): anyReturn Value:
any: 委托对象。
setRequiresSecureCoding
Section titled “setRequiresSecureCoding”设置是否要求安全编码。
setRequiresSecureCoding(b: boolean): voidParameters:
| Name | Type | Description |
|---|---|---|
b | boolean | 是否要求。 |
Return Value:
- 无。
containsValueForKey
Section titled “containsValueForKey”是否包含某键。
containsValueForKey(key: string): booleanParameters:
| Name | Type | Description |
|---|---|---|
key | string | 键。 |
Return Value:
boolean: 是否包含。
decodeObjectForKey
Section titled “decodeObjectForKey”解码对象。
decodeObjectForKey(key: string): anyParameters:
| Name | Type | Description |
|---|---|---|
key | string | 键。 |
Return Value:
any: 对象。
decodeBoolForKey
Section titled “decodeBoolForKey”解码布尔。
decodeBoolForKey(key: string): booleanParameters:
| Name | Type | Description |
|---|---|---|
key | string | 键。 |
Return Value:
boolean: 值。
decodeIntForKey
Section titled “decodeIntForKey”解码 int。
decodeIntForKey(key: string): numberParameters:
| Name | Type | Description |
|---|---|---|
key | string | 键。 |
Return Value:
number: 值。
decodeInt32ForKey
Section titled “decodeInt32ForKey”解码 int32。
decodeInt32ForKey(key: string): numberParameters:
| Name | Type | Description |
|---|---|---|
key | string | 键。 |
Return Value:
number: 值。
decodeInt64ForKey
Section titled “decodeInt64ForKey”解码 int64。
decodeInt64ForKey(key: string): numberParameters:
| Name | Type | Description |
|---|---|---|
key | string | 键。 |
Return Value:
number: 值。
decodeFloatForKey
Section titled “decodeFloatForKey”解码 float。
decodeFloatForKey(key: string): numberParameters:
| Name | Type | Description |
|---|---|---|
key | string | 键。 |
Return Value:
number: 值。
decodeDoubleForKey
Section titled “decodeDoubleForKey”解码 double。
decodeDoubleForKey(key: string): numberParameters:
| Name | Type | Description |
|---|---|---|
key | string | 键。 |
Return Value:
number: 值。
decodeBytesForKeyReturnedLength
Section titled “decodeBytesForKeyReturnedLength”解码字节数组。
decodeBytesForKeyReturnedLength(key: string, lengthp: any): anyParameters:
| Name | Type | Description |
|---|---|---|
key | string | 键。 |
lengthp | any | 输出参数,接收长度。 |
Return Value:
any: 字节指针。
finishDecoding
Section titled “finishDecoding”完成解码。
finishDecoding(): voidReturn Value:
- 无。