From my app, I can download a zip file from a server through NSURLConnection. While I'm downloading I'm writing to this into a file, so that it will save into documentsDirectory.
paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
documentsDirectory = [paths objectAtIndex:0];
currentDownload = [documentsDirectory stringByAppendingString:@"/Zipfile"];
NSFileHandle *fileHandle = [NSFileHandle fileHandleForWritingAtPath:currentDownload];
Every application is sandboxed in iPhone.Each application have it's on directory structure in device (like in simulator).
The path of document directory in mobile is something like:
The files in that directories cannot be accesses by any other applications. It can be accessed by the owner application itself. And can be accessed through code.
If you want to see the files in document directory you need to set the
UIFileSharingEnabled key in the info.plist
The files in the application's document directory will be displayed on the itunes as like:
Please check the tutorial for details.