NSData *data = [[NSData alloc] init];
NSLog(@"length:%lu", data.length); //0
NSMutableData *mdata = [[NSMutableData alloc] initWithCapacity:10];
NSLog(@"length:%lu", mdata.length); //0
NSMutableData *mdata1 = [[NSMutableData alloc] initWithLength:10];
NSLog(@"length:%lu", mdata1.length); //10
网友评论