iOS 计算UIImage的占用内存大小:
NSData * imageData = UIImageJPEGRepresentation(image,1);
length = [imageData length]/1000;
注意:
lenth/1000,不是1024,是1000!因为Mac和ios系统的内存换算单位都是1000;
即:
1kb = 1000B;
1MB = 1000kb;
NSData * imageData = UIImageJPEGRepresentation(image,1);
length = [imageData length]/1000;
lenth/1000,不是1024,是1000!因为Mac和ios系统的内存换算单位都是1000;
即:
1kb = 1000B;
1MB = 1000kb;