Contents

encodeArray(ofObjCType:count:at:)

Encodes an array of the given Objective-C type, provided the number of items and a pointer.

Declaration

func encodeArray(ofObjCType type: UnsafePointer<CChar>, count: Int, at array: UnsafeRawPointer)

Discussion

The values are encoded from the buffer beginning at address. itemType must contain exactly one type code. NSCoder’s implementation invokes encodeValue(ofObjCType:at:) to encode the entire array of items. Subclasses that implement the encodeValue(ofObjCType:at:) method do not need to override this method.

This method must be matched by a subsequent decodeArray(ofObjCType:count:at:) message.

For information on creating an Objective-C type code suitable for itemType, see Type Encodings.

Special Considerations

You should not use this method to encode C arrays of Objective-C objects. See decodeArray(ofObjCType:count:at:) for more details.

See Also

Encoding General Data