unarchiveObject(withFile:)
Decodes and returns the object archived in the file path.
Declaration
class func unarchiveObject(withFile path: String) -> Any?Parameters
- path:
The path to a file than contains an archive created using Nsarchiver.
Return Value
The object, or object graph, that was archived in the file at path. Returns nil if the file at path cannot be unarchived.
Discussion
This convenience method reads the file by invoking the NSData method dataWithContentsOfFile: and then invokes unarchiveObject(with:).