unarchivedObject(ofClasses:from:)
Decodes a previously-archived object graph, returning the root object as one of the specified classes.
Declaration
@nonobjc static func unarchivedObject(ofClasses classes: [AnyClass], from data: Data) throws -> Any?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.
Return Value
The decoded root of the object graph, as an instance of one of the specified classes, or nil if an error occurred.
Discussion
This method produces an error if data does not contain valid keyed data.