如何在Objective-C中将NSData附加到NSData?

时间:2016-06-10 06:14:45

标签: ios objective-c nsdata nsmutabledata

我要在Objective-C中将NSData追加到NSData

我该怎么做?

1 个答案:

答案 0 :(得分:4)

 NSMutableData *first_data = [NSMutableData dataWithContentsOfURL:self.firstURL];
 NSMutableData *second_data = [NSMutableData dataWithContentsOfURL:self.secondURL];
 [first_data appendData:second_data];
 [first_data writeToURL:url atomically:YES];