Encodes a value of the given type at the given address.
SDKs
- iOS 2.0+
- macOS 10.0+
- Mac Catalyst 13.0+
- tvOS 9.0+
- watchOS 2.0+
Framework
- Foundation
Declaration
func encodeValue(ofObjCType type: Unsafe Pointer<Int8>, at addr: Unsafe Raw Pointer)
Discussion
Subclasses must override this method, and match it with a subsequent decode
message.
When calling this method, value
must contain exactly one type code.
For information on creating an Objective-C type code suitable for value
, see Type Encodings.
Special Considerations
You should not use this method to encode Objective-C objects. See decode
for more details.