NSKeyedArchiverNSKeyedUnarchiver
NSKeyedArchiver and NSKeyedUnarchiver are classes in Apple's Foundation framework used to encode and decode objects into and from a keyed archive. They rely on objects conforming to the NSCoding protocol, which requires implementing encodeWithCoder: and initWithCoder:. Through a dictionary-like set of keys, an object graph can be serialized into a binary or XML-style representation and later reconstructed. The archived data can be written to files or kept in memory as NSData.
In typical usage, a root object is encoded by the archiver, which recursively encodes its contained objects.
Security and compatibility considerations are important. Enabling NSSecureCoding on your classes and using the secure variants