Encodes a series of values of potentially differing Objective-C types.
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
value is a C string containing any number of type codes. The variable arguments to this method consist of one or more pointer arguments, each of which specifies a buffer containing the value to be encoded. For each type code in
value, you must specify a corresponding pointer argument.
This method must be matched by a subsequent
NSCoder’s implementation invokes
encode to encode individual types. Subclasses that implement the
encode method do not need to override this method. However, subclasses that provide a more efficient approach for encoding a series of values may override this method to implement that approach.
For information on creating Objective-C type codes suitable for
value, see Type Encodings.
You should not use this method to encode Objective-C objects. See
decode for more details.