I have a question that most of you might find a little odd. I am making an application for OS X, but I need it to write text files into an iPhone folder. I know the iPhone will have to be connected to the computer, and I do not think that emailing will work.
I thought it would be as simple as finding a path to the iPhone while it was connected (such as /iPhone/Documents), but I cannot figure out what the path is. If anybody can tell me how to find the path, or can give me a link to some useful information, I will be very greatful
EDIT: although it was not the answer I wanted, I got what I needed. I think all of these answers gave me an equal amount of information, so I had a hard time choosing which answer to accept. I accepted the one that provided me with an alternative way to get the files onto the iPhone. Thanks for all of the help, everyone!
Drag and drop files from a folder or window onto the Documents list to copy them to your device. You can also click Add in the Documents list in iTunes, find the file or files you want to copy from your computer, and then click Add. iTunes copies these files to the app on your device.
Generally, most people save files to the “Downloads” folder, so tap it. You'll see a list of all the files you've downloaded.
Tap Share, then scroll down and select Save to Files. Now choose a folder under On my iPhone and then tap Save in the top right. To move a document from your iCloud to your iPhone, open up the files app and deep (or long) press the file that you want to move until some options come up.
You will only be able to transfer files to and from your application using iTunes.
In order to get this to work your app must register for sharing documents in the Info.plist file by setting the UIFileSharingEnabled
key to YES
. When this is done your app will when installed and the device in connected show up on the "Application" tab in iTunes at the bottom. Highlight the app in the list to the left, and drag and drop files to the list on the right.
This way any file stored in the applications documents folder will be visible to iTunes, and any file copied to the device in iTunes will show up in the documents folder. You find the documents folder in your app like this:
NSArray* paths = NSSearchPathForDirectoriesInDomains(
NSDocumentDirectory, NSUserDomainMask, YES);
NSString* path = [paths lastObject];
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With