我希望获取UIImage对象的实际内存大小。有3种方法:
NSUInteger s1 = UIImagePNGRepresentation(thumbImage).length;
NSUInteger s2 = UIImageJPEGRepresentation(thumbImage, 1).length;
NSUInteger s3 = CGImageGetHeight(thumbImage.CGImage) * CGImageGetBytesPerRow(thumbImage.CGImage);
NSLog(@"s1:%u",s1);
NSLog(@"s2:%u",s2);
NSLog(@"s3:%u",s3);
并且结果
s1:62734
s2:175939
s3:578816
哪一个是正确的?