문제

My problem is the next> I have to receive data from an external accessory and save it into a big NSData, each time I receive a stream I have to copy that NSData into another one:

CompleteNSData = NSDataTx1 + NSDataTx2 + NSDataTx3;

and at the end show the whole info to the user.

도움이 되었습니까?

해결책

Edited since the question was changed:

If you need to concatenate multiple NSData objects into one then something like this will work:

NSData *data1 = ... // the 1st NSData object
NSData *data2 = ... // the 2nd NSData object
NSData *data3 = ... // the 3rd NSData object
NSMutableData *completeData = [data1 mutableCopy];
[completeData appendData:data2];
[completeData appendData:data3];

Call appendData: for each NSData you need to append.

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top