Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

getting number of bytes from an instance of NSMutableData

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?

like image 672
zpesk Avatar asked Dec 10 '25 15:12

zpesk


1 Answers

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.

like image 152
JonathonW Avatar answered Dec 12 '25 09:12

JonathonW