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!
Recombining NSData objects after a download
142 Views Asked by Crystal At
1
There are 1 best solutions below
Related Questions in IPHONE
- UIWebView Screen Fitting Issue
- ios responsive design not working (too wide in portrait orientation)
- Setting View orientation to portrait is ignored
- How do I add custom cells to TableView in Swift?
- UIWebView not loading URL in simulator
- What is the limit for number of subscribers to a stream(publisher's) in opentok/tokbox iOS SDK?
- How to generate request format for WCF web service method for Mac and iPhone
- Difference between gethostname() and [NSProcessInfo hostName]?
- How to force close ipad/iphone keypad when input element is not focused using JS?
- iOS app rejected because of in-app purchase
- iOS coordinates for iPad and iPhone game using spritekit
- What is the best practice when making a storyboard for iPhone and iPad?
- Labels properties changing in Xcode
- Terminating app due to uncaught exception
- Exchange plist data between 2 iPad using iCloud
Related Questions in NSDATA
- How to make animated gif image in IOS
- Write NSData in NSHomeDirectory
- NSData dataWithContentsOfFile returns different results on device
- NSData dataWithContentsOfURL returning nil specifically in iOS 8
- Swift 2.0 NSData(contentsOfURL) always nil in-app but the same code run well in playground
- Can't load image with UIImage or NSData
- Convert NSValue to NSData and back again, with the correct type
- Check If Server's Image is Already Updated and Download Again
- Raw Base64 bytes into base64 string
- Sending NSData over network to other computer/device
- Convert data to an UIImageView
- iOS overwrite EXIF flash property with new value for front camera flash
- writeToFile: returning correct path, but no file?
- set the background Image for View using blocks in ios?
- NSString from NSData returns nil
Related Questions in NSFILEHANDLE
- How can I replace 12 byte data from a local file?
- What's the advantages of using NSOutputstream?
- NSFileHandle fileHandleForWriting returns nil, error code 24
- NSFileHandle & Writing Asynch to a file in iOS
- NSTask pipes output to Console rather than the NSFileHandle
- echo Does Not Work with NSTask and readInBackgroundAndNotify
- NSTask/Process + NSPipe + NSFileHandle in Modern Swift Concurrency
- Clang NSTask with streams
- How to use NSFileHandle's writeabilityHandler?
- How to insert data to text file with using NSFileHandle
- Can someone help me spot a leak in this NSPipe/NSFileHandle code?
- Recombining NSData objects after a download
- Downloading a video from a remote URL into device and streaming it via AVPlayer
- Terminating NSTask with NSFileHandle set for standard output
- I cannot catch the "No space left on device" exception when using NSFileHandle writedata function
Related Questions in NSMUTABLEDATA
- NSMutableData to NSDictionary returning null
- Converting INT to Hex string to be sent over BLE
- Uploading an image to php server from iphone
- Using the bytes of an NSMutableData instance while allowing it to be autoreleased
- NSMutableData initWithCapacity absurd capacity?
- How to know if Objective C class cleans memory that it internally created with malloc under ARC?
- NSMutableData - unrecognized selector sent to instance
- NSMutableData cannot be read
- NSMutableData response string
- appending erased file has too much disturbed noice
- Getting length of NSMutableData
- Clear out contents in NSMutableData
- NSMutableData appendData with NSArray data
- How to Append PDF files in iOS SDK
- NSMutableData capacity on length change
Trending Questions
- UIImageView Frame Doesn't Reflect Constraints
- Is it possible to use adb commands to click on a view by finding its ID?
- How to create a new web character symbol recognizable by html/javascript?
- Why isn't my CSS3 animation smooth in Google Chrome (but very smooth on other browsers)?
- Heap Gives Page Fault
- Connect ffmpeg to Visual Studio 2008
- Both Object- and ValueAnimator jumps when Duration is set above API LvL 24
- How to avoid default initialization of objects in std::vector?
- second argument of the command line arguments in a format other than char** argv or char* argv[]
- How to improve efficiency of algorithm which generates next lexicographic permutation?
- Navigating to the another actvity app getting crash in android
- How to read the particular message format in android and store in sqlite database?
- Resetting inventory status after order is cancelled
- Efficiently compute powers of X in SSE/AVX
- Insert into an external database using ajax and php : POST 500 (Internal Server Error)
Popular Questions
- How do I undo the most recent local commits in Git?
- How can I remove a specific item from an array in JavaScript?
- How do I delete a Git branch locally and remotely?
- Find all files containing a specific text (string) on Linux?
- How do I revert a Git repository to a previous commit?
- How do I create an HTML button that acts like a link?
- How do I check out a remote Git branch?
- How do I force "git pull" to overwrite local files?
- How do I list all files of a directory?
- How to check whether a string contains a substring in JavaScript?
- How do I redirect to another webpage?
- How can I iterate over rows in a Pandas DataFrame?
- How do I convert a String to an int in Java?
- Does Python have a string 'contains' substring method?
- How do I check if a string contains a specific word?
It really depends on the memory constraints. If the x00M files are too much to handle in memory with the
NSDataobject 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.