Question

I broke up a file into 50 mb packets on the server side and when I receive it on the iPad, I receive as NSData object through NSURLConnection. To restitch the data, do I create an empty NSMutableData object and just appendData the packets back together in order? Or am I supposed to use NSFileHandle, write to file, seek to end of file, write next file, seek to end of file, rinse, repeat? Thanks!

Was it helpful?

Solution

It really depends on the memory constraints. If the x00M files are too much to handle in memory with the NSData object you will have to go the second route (which I think is a great approach). You can check with Instruments if you are within acceptable limits.

Seeing that you want to do this on an iPhone, it is very likely that you will have to do it via the file system.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top