So I know iOS apps run in a sandbox and all, but I thought I remembered Apple mentioning a way for apps to write to and read from a common file share, so that you can then deal with these files on your computer when you plug you iPhone in (mount the drive). I think this was in the context on the iPad, but I’m not sure.
Anybody know anything more of this? It’s kind of a tough thing to search for.
Each app has a Documents directory where it can write files. To get the apps Documents directory you can use:
To write say “Hello, World!” to a file called
hello.txtin the documents directory you could do something like:If you set
UIFileSharingEnabledin your app’sInfo.plisttoYESthe the files will be visible in iTunes when the device is connected and can be accessed by the user from there.