One Logo Pool Ball
Foundation · IOS API REFERENCE

NSKeyedUnarchiver

class · SDK 27.1

class NSKeyedUnarchiver

Members (31)

static

class

TypeScript
static classForClassName(codedName: string): (string) | null
Swift declaration
class func `class`(forClassName codedName: String) -> AnyClass?
static

setClass

TypeScript
static setClassForClassName(cls: (string) | null, codedName: string): void
Swift declaration
class func setClass(_ cls: AnyClass?, forClassName codedName: String)
static · iOS 2.0+ · Deprecated in iOS 12.0

unarchiveObject

TypeScript
static unarchiveObjectWith(data: ArrayBuffer): (unknown) | null
Swift declaration
class func unarchiveObject(with data: Data) -> Any?
static · iOS 2.0+ · Deprecated in iOS 12.0

unarchiveObject

TypeScript
static unarchiveObjectWithFile(path: string): (unknown) | null
Swift declaration
class func unarchiveObject(withFile path: String) -> Any?
static · iOS 11.0+

unarchivedObject

TypeScript
static unarchivedObjectOfClassesFrom(classes: Array<unknown>, data: ArrayBuffer): unknown
Swift declaration
class func unarchivedObject(ofClasses classes: Set<AnyHashable>, from data: Data) throws -> Any
method

class

TypeScript
classForClassName71108(codedName: string): (string) | null
Swift declaration
func `class`(forClassName codedName: String) -> AnyClass?
method

containsValue

TypeScript
containsValue(key: string): boolean
Swift declaration
func containsValue(forKey key: String) -> Bool
method

decodeBool

TypeScript
decodeBool(key: string): boolean
Swift declaration
func decodeBool(forKey key: String) -> Bool
method

decodeBytes

TypeScript
decodeBytes(key: string, lengthp?: (SDKHandle) | null): (SDKHandle) | null
Swift declaration
func decodeBytes(forKey key: String, returnedLength lengthp: UnsafeMutablePointer<Int>?) -> UnsafePointer<UInt8>?
method

decodeDouble

TypeScript
decodeDouble(key: string): number
Swift declaration
func decodeDouble(forKey key: String) -> Double
method

decodeFloat

TypeScript
decodeFloat(key: string): number
Swift declaration
func decodeFloat(forKey key: String) -> Float
method

decodeInt32

TypeScript
decodeInt32(key: string): number
Swift declaration
func decodeInt32(forKey key: String) -> Int32
method

decodeInt64

TypeScript
decodeInt64(key: string): number
Swift declaration
func decodeInt64(forKey key: String) -> Int64
method

decodeObject

TypeScript
decodeObject(key: string): (unknown) | null
Swift declaration
func decodeObject(forKey key: String) -> Any?
method

finishDecoding

TypeScript
finishDecoding(): void
Swift declaration
func finishDecoding()
init · iOS 2.0+ · Deprecated in iOS 12.0

init

TypeScript
static init(): NSKeyedUnarchiver
Swift declaration
init()
init · iOS 11.0+

init

TypeScript
static initForReadingFrom(data: ArrayBuffer): NSKeyedUnarchiver
Swift declaration
init(forReadingFrom data: Data) throws
init · iOS 2.0+ · Deprecated in iOS 12.0

init

TypeScript
static initForReadingWith(data: ArrayBuffer): NSKeyedUnarchiver
Swift declaration
init(forReadingWith data: Data)
method

setClass

TypeScript
setClassForClassName52054(cls: (string) | null, codedName: string): void
Swift declaration
func setClass(_ cls: AnyClass?, forClassName codedName: String)
get · iOS 9.0+

decodingFailurePolicy

TypeScript
get decodingFailurePolicy(): NSCoder_DecodingFailurePolicy
Swift declaration
var decodingFailurePolicy: NSCoder.DecodingFailurePolicy { get set }
set · iOS 9.0+

decodingFailurePolicy

TypeScript
set decodingFailurePolicy(value: NSCoder_DecodingFailurePolicy)
Swift declaration
var decodingFailurePolicy: NSCoder.DecodingFailurePolicy { get set }
get

delegate

TypeScript
get delegate(): (SDKHandle) | null
Swift declaration
unowned(unsafe) var delegate: (any NSKeyedUnarchiverDelegate)? { get set }
set

delegate

TypeScript
set delegate(value: (Implements<NSKeyedUnarchiverDelegate> | SDKHandle) | null)
Swift declaration
unowned(unsafe) var delegate: (any NSKeyedUnarchiverDelegate)? { get set }
get · iOS 6.0+

requiresSecureCoding

TypeScript
get requiresSecureCoding(): boolean
Swift declaration
var requiresSecureCoding: Bool { get set }
set · iOS 6.0+

requiresSecureCoding

TypeScript
set requiresSecureCoding(value: boolean)
Swift declaration
var requiresSecureCoding: Bool { get set }
method · iOS 9.0+

decodeDecodable

TypeScript
decodeDecodable(type: "Bool" | "Int" | "UInt" | "Double" | "Float" | "String" | "CGFloat" | "Date" | "URL" | "Data" | "UUID", key: string): (unknown) | null
Swift declaration
@nonobjc func decodeDecodable<T>(_ type: T.Type, forKey key: String) -> T? where T : Decodable

Decodes a decodable value associated with a given key. - Parameters: - type: The type of the value to decode. - key: The key in the archive associated with the value to decode. - Returns: The decoded value, or `nil` if decoding fails.

static · iOS 11.0+

unarchivedObject

TypeScript
static unarchivedObjectOfClassesFrom12219(classes: Array<string>, data: ArrayBuffer): (unknown) | null
Swift declaration
@nonobjc static func unarchivedObject(ofClasses classes: [AnyClass], from data: Data) throws -> Any?

Decodes a previously-archived object graph, returning the root object as one of the specified classes. This method produces an error if `data` does not contain valid keyed data. > Important: Make sure you have adopted `NSSecureCoding` in the types you decode. If any call to a `decode`-prefixed method fails, the default `decodingFailurePolicy` sets the error rather than throwing an exception. In this case, the current and all subsequent decode calls return `0` or `nil`. - Parameters: - classes: A set of classes, at least one of which the root object should conform to. - data: An object graph previously encoded by `NSKeyedArchiver`. - Returns: The decoded root of the object graph, as an instance of one of the specified classes, or `nil` if an error occurred.

static · iOS 14.0+

unarchivedDictionary

TypeScript
static unarchivedDictionary(keyClasses: Array<string>, objectClasses: Array<string>, data: ArrayBuffer): (NativeMap<unknown, unknown>) | null
Swift declaration
@nonobjc static func unarchivedDictionary(keysOfClasses keyClasses: [AnyClass], objectsOfClasses objectClasses: [AnyClass], from data: Data) throws -> [AnyHashable : Any]?
method · iOS 9.0+

decodeTopLevelDecodable

TypeScript
decodeTopLevelDecodable(type: "Bool" | "Int" | "UInt" | "Double" | "Float" | "String" | "CGFloat" | "Date" | "URL" | "Data" | "UUID", key: string): (unknown) | null
Swift declaration
@nonobjc func decodeTopLevelDecodable<T>(_ type: T.Type, forKey key: String) throws -> T? where T : Decodable

Decodes a top-level decodable value associated with a given key. If the archive is not a valid property list, this method throws a `DecodingError.dataCorrupted` error. If a value within the archive fails to decode, this method throws the corresponding error. - Parameters: - type: The type of the value to decode. - key: The key in the archive associated with the value to decode. - Returns: The decoded value, or `nil` if the key is not present.

static · iOS 14.0+

unarchivedArrayOfObjects

TypeScript
static unarchivedArrayOfObjects(classes: Array<string>, data: ArrayBuffer): (Array<unknown>) | null
Swift declaration
@nonobjc static func unarchivedArrayOfObjects(ofClasses classes: [AnyClass], from data: Data) throws -> [Any]?
static · iOS 9.0+ · Deprecated in iOS 12.0

unarchiveTopLevelObjectWithData

TypeScript
static unarchiveTopLevelObjectWithData(data: ArrayBuffer): (unknown) | null
Swift declaration
@nonobjc class func unarchiveTopLevelObjectWithData(_ data: Data) throws -> Any?

Decodes a previously-archived object graph, and returns the root object. This method throws an error if `data` does not contain valid keyed data. - Parameter data: An object graph previously encoded by `NSKeyedArchiver`. - Returns: The unarchived object, or `nil` if an error occurred.

Skipped declarations

3 declarations were excluded from these bindings. Each reason comes from the generator or the iOS SDK compiler.

NSKeyedUnarchiver.unarchivedObject(ofClass:from:)

The iOS SDK compiler rejected this binding: static method 'unarchivedObject(ofClass:from:)' requires that 'NSObject' conform to 'NSCoding'

NSKeyedUnarchiver.unarchivedArrayOfObjects(ofClass:from:)

The iOS SDK compiler rejected this binding: static method 'unarchivedArrayOfObjects(ofClass:from:)' requires that 'NSObject' conform to 'NSSecureCoding'

NSKeyedUnarchiver.unarchivedDictionary(ofKeyClass:objectClass:from:)

The iOS SDK compiler rejected this binding: static method 'unarchivedDictionary(ofKeyClass:objectClass:from:)' requires that 'NSObject' conform to 'NSCopying'

All Foundation types →