getting number of bytes from an instance of NSMutableData

cocoa, cocoa-touch, iphone

Solution

Simple:

if([data length] == 0) {
  //do something
}

where data is your NSMutableData object.

NSMutableData inherits from NSData, so it gains all of the members of NSData.

Problem

I want to be able to determine if the number of bytes in an instance of NSMutableData is equal to zero. How would I do this?

Original source