Contents

bytes

A pointer to the data object’s contents.

Declaration

var bytes: UnsafeRawPointer { get }

Discussion

If the length of the NSData object is 0, this property returns nil.

For an immutable data object, the returned pointer is valid until the data object is deallocated. For a mutable data object, the returned pointer is valid until the data object is deallocated or the data is mutated.

See Also

Related Documentation

Accessing Underlying Bytes