Ok, I'm a little stumped here, as I've never really dealt with anything this low level. Say I want to add the following bytes to an NSMutableData
object:
0x01, 0xF, 0x64, 0x0, 0x6A
How do I even go about doing this? I imagine it's something to do with the appendBytes:length:
method, but I honestly don't know how to transform what I have above into an NSMutableData.
Any help would be greatly appreciated!
This should do it:
NSMutableData *data = [NSMutableData data];
char bytesToAppend[5] = {0x01, 0xf0, 0x64, 0x0, 0x6a};
[data appendBytes:bytesToAppend length:sizeof(bytesToAppend)];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With