convert NSMutableData to NSData


-(NSData*)FunTest{

NSMutableData *theData = [NSMutableData data];
char bytesToAppend[5] = {0x01, 0xf0, 0x64, 0x0, 0x6a};
[theData appendBytes:bytesToAppend length:sizeof(bytesToAppend)];
[theData appendBytes:bytesToAppend length:sizeof(bytesToAppend)];
NSData *immutableData = [NSData dataWithData:theData];
return immutableData;
}


Leave a Reply