decodeClassName(_:asClassName:)
Instructs instances of NSUnarchiver to use the class with a given name when instantiating objects whose ostensible class, according to the archived data, is another given name.
Declaration
class func decodeClassName(_ inArchiveName: String, asClassName trueName: String)Parameters
- inArchiveName:
The ostensible name of a class in an archive.
- trueName:
The name of the class to use when instantiating objects whose ostensible class, according to the archived data, is
nameInArchive.
Discussion
This method enables easy conversion of unarchived data when the name of a class has changed since the archive was created.
Note that there is also an instance method of the same name. An instance of NSUnarchiver can maintain its own mapping of class names. However, if both the class method and the instance method have been invoked using an identical value for nameInArchive, the class method takes precedence.