objective-c 下面int 和 NSData数据 互相转换的方法

抄自这里

int i = 1;
NSData *data = [NSData dataWithBytes: &i length: sizeof(i)];


int i;
[data getBytes: &i length: sizeof(i)];
原文地址:https://www.cnblogs.com/ziyouchutuwenwu/p/4779510.html