像这样设置 NSMutableData 时:
NSMutableData* mRgb = [NSMutableData dataWithCapacity:3];
((char*)[mRgb mutableBytes])[0] = 10;
((char*)[mRgb mutableBytes])[1] = 90;
((char*)[mRgb mutableBytes])[2] = 160;
我有长度仍然为0的问题:
int len = [mRgb length]; // Is 0!
为什么呢?