How to write files with UIDcomentBrowserViewController - ios

Is where a way to read/write multiple files in UIDocumentBrowserViewController.
Recently, I know UIDocumentBrowserViewController as rootViewController can read files. But how to write files.
For example, i want to read zip file and then unzip it to current folder.

Related

Manually re-compress an unzipped system.iopackage to a working Excel file

System.IO.Packaging is easy to work with because the resulting files are ZIPped folders, so you can simply rename the file to .zip and then open it. I do this with XLSX files to see how they are built.
Unfortunately, the reverse is not true; if you re-compress the folder and rename it .XLSX, Excel with say it has unreadable content. This is true even if the file is unchanged. If you simply rename, extract all, recompress, rename, the resulting file does not work.
Poking about inside, it seems the format of the file is not a canonical zip, header information is missing?
Anyone know an easy trick to recompress these files in Explorer? It would be nice to be able to test changes.

How can I access my app's temp files with Xcode?

On iOS, I save a file in /tmp, using NSTemporaryDirectory(). Can I access it with Xcode to see what was there ?
Note: Im not looking for NSLog for various reasons, I want to save to a file and retrieve this file with Xcode or some other tool, for debug. I don't care so much if the file is in /tmp or in another directory.

Zip files not getting created by System.IO.Compression

Can System.IO.Compression assembly create zip files of some specific files like .txt, .bak or it simply create zip file of directory? I am not being able to craete zip files of specific files but rather only the zip file of directory is getting created
You can create a ZipArchive object and then add individual files (including just one) by creating ZipArchiveEntry objects.
As a convenience, the ZipFileExtensions class has an CreateEntryFromFile method.

Save multiple files as one package with custom file type

I need to save multiple files as one custom file, which then can be exported and imported into the iOS app. The files that go into this package are PDFs and TXTs.
A .pages file on the Mac is pretty much exactly what I want, it is a package which contains the original files, but acts as a custom (Pages) file.
I looked into NSFileWrapper, NSKeyedArchiver and NSFileManager, but I can't find the right way to solve this problem. How can I export multiple files into one package on iOS, that I can save with my own file extension and where I can easily get the original files out when importing?

Create a writable folder on iOS device

How does one create a read/write folder on the same level as the Documents directory? Is there a way to set the directory used in file sharing on iOS between iTunes and an app, or is it hard coded to the Documents directory?
On a non-jailbroken device, you cannot create a read/write folder on the same level as the Documents directory. Additionally, there is not way to change the directory used in file sharing.
If you need to create files and want to keep them away from file sharing, there are other writable directories that can be used. This SO question & answer deals with that quite well.

Resources