app crashes while writing data together
<p>I am trying to write NSData objects together.  It's a 450 mb file.  I'm doing it with 50mb chunks like so:</p>

<pre><code>for (NSString *packetName in listOfFiles) {
                    NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
                    NSString *packetPath = [[self applicationDocumentsDirectory] stringByAppendingPathComponent:packetName];

                NSData *packetData = [[NSData alloc] initWithContentsOfFile:packetPath];

                [output seekToEndOfFile];
                [output writeData:packetData];

                [fileManager removeItemAtPath:packetPath error:&amp;error];
                NSLog(@"Removed file after appending data success: %i Error: %@", success, [error localizedDescription]);
                [self updateManifestColumn:@"IsParsed" withValue:YES forFile:packetName inTable:tableName];

                packetData = nil;
                [packetData release];
                [pool release];
        }
        [output closeFile];
</code></pre>

<p>I call this method, right after I received the packets in connectionDidFinishLoading.  I saved those files to the Documents directory so the user could download first on Wifi, and then the restitching could happen afterwards.  This is done in a DataManager class which handles these types of operations so I don't have didReceiveMemoryWarning like I would in a ViewController. I do not get a Memory warning on the Console when I run the app on the device connected to my machine.  </p>

<p>What should I do if it's in the middle of writing the data to ensure that the data is correct when the user receives it?  Would it be better to do this with smaller packets?  Does that make it safer?  Thanks!</p>
