length is an NSUInteger type data, representing the length of data, and bytes is a pointer, pointing to the content of data. There is no question of equality, inequality, or whether they can be replaced with each other.
@property(readonly) NSUInteger length
The number of bytes contained by the data object.
@property(readonly) const void *bytes
A pointer to the receiver’s contents.
length is an NSUInteger type data, representing the length of data, and bytes is a pointer, pointing to the content of data. There is no question of equality, inequality, or whether they can be replaced with each other.