I\'ve an NSData object, the length is 4 bytes .These four bytes i\'m extracting from another NSData object using ,
fourByteData=[completeData subdataWithRang
That statement would give you the first 16 bytes of data, not 4. To get the first 4 bytes you need to modify your statement to:
fourByteData = [completeData subdataWithRange:NSMakeRange(0, 4)];
To read the data from the NSData Object to an integer you could do something like:
int theInteger;
[completeData getBytes:&theInteger length:sizeof(theInteger)];
You do not need to get the first 4 bytes if you are just converting it to an integer. You can do this directly from the two lines above and your completeData
receiver