voidencodeWithCoderNSCoder
Void encodeWithCoder NSCoding method overview
encodeWithCoder: is the Objective-C instance method used to save an object's state into a coder, making the object eligible for archiving and persistence. It is a required method of the NSCoding protocol, and it is paired with initWithCoder: to support round-trip encoding and decoding. In practical terms, an object implements this method to write its properties into the provided NSCoder, so that later it can be restored.
In Objective-C, the method is declared as - (void)encodeWithCoder:(NSCoder )coder;. When an object is archived with mechanisms
A typical implementation encodes each relevant property, using appropriate coder methods such as encodeObject:forKey:, encodeInteger:forKey:, encodeBool:forKey:,
The complementary implementation in initWithCoder: retrieves values with decodeObjectForKey:, decodeIntegerForKey:, decodeBoolForKey:, etc., and assigns them to
encodeWithCoder: is used with keyed archivers such as NSKeyedArchiver and NSKeyedUnarchiver, enabling robust persistence of complex