I want construct a NSData object that contents 3 NSInteger type, and I do with follow codes:
- (void)test
{
NSInteger i = 12, j = 2000, k = 2;
NSMutableData *md = [NSMutableData dataWithCapacity:10];
[md appendBytes:&i length:sizeof(i)];
[md appendBytes:&j length:sizeof(j)];
[md appendBytes:&k length:sizeof(k)];
NSLog(@"data is %@",md);
}
But when I log it, it shows me that:
data is <0c000000 d0070000 02000000>
I translate these into decimal, these number are 201326592, 3490119680, 33554432. So I don't know why is these numbers, what should I do? Thanks.