I have to merge two data objects and later separate them.Can anybody suggest me the way to go about it.It's urgent!!!!!! please respond fast.... Thanks
A:
Have a look at NSMutableData. Specifically, look at the appendData: and appendBytes:Length methods.
You can 'merge' two NSData objects by appending them to an empty NSMutableData object. You can then probably retrieve the data using getBytes:range: and reconstruct your NSData object with dataWithBytes:Length:.
Have a look at this article for working with mutable binary data (includes sample code).
Nebs
2010-06-30 14:05:12
i tried that but i dont know the length of my NSData object
Ajayvictor007
2010-06-30 14:32:40
Have you tried NSData's 'length' property?
Nebs
2010-06-30 14:39:50