Contents

decodeData()

Decodes and returns an NSData object that was previously encoded with Encode(_:) 1qd1e. Subclasses must override this method.

Declaration

func decodeData() -> Data?

Discussion

The implementation of your overriding method must match the implementation of your encode(_:) method. For example, a typical encode(_:) method encodes the number of bytes of data followed by the bytes themselves. Your override of this method must read the number of bytes, create an NSData object of the appropriate size, and decode the bytes into the new NSData object.

See Also

Decoding General Data