- encoder
- The encoder object where the state of the object will be stored
This method is part of the Foundation.NSCoding protocol and is used by applications to preserve the state of the object into an archive.
Users will typically create a Foundation.NSKeyedArchived and then invoke the NSKeyedArchived.ArchiveRootObjectToFile which will call into this method
If you want to allow your object to be archived, you should override this method and store your state in using the provided encoder parameter. In addition, you should also implement a constructor that takes an NSCoder argument and is exported with [Export ("initWithCoder:")]
c# Example
public void override EncodeTo (NSCoder coder){ c.Encode (1, key: "version"); c.Encode (userName, key: "userName"); c.Encode (hostName, key: "hostName");