How to get Database into & out of IOS device?

Is it possible to load and unload from the computer to the IOS device, similar to the way FileMaker does? If so HOW?

You can use iTunes file sharing, which lets you move files between your device and the computer.

info.plist to your project.

[code]<?xml version="1.0" encoding="UTF-8"?>

UIFileSharingEnabled [/code]

The iOS Apple dev library search is broken, so I could not locate their doc.

Unfortunately, all googled docs describe the process for O-C. Like

Thanks Michel. I have been looking at Apple Dev support and could not find anything, however I never have had luck find stuff on Apple Dev,
I found several things, with Google help, about using XML and JSON; and NSCoreData.
I’ll take a look at your link.

Thanks again.

Make a script after build and insert this :

Dim App As String = CurrentBuildLocation + "/" + CurrentBuildAppName Dim mycommand As String = "/usr/bin/defaults write " + App + "/Info.plist UIFileSharingEnabled YES" Call DoShellCommand (mycommand)

Realise this thread is pretty old now, but did you ever try using the “Copy Files” build step?

(Insert -> Build Step -> Copy Files)

You can specify the destination and subdirectory within your app that the files will be copied to. (I just found this out myself a moment ago, but it seems to work as you describe).

Follow-up : it is broken only when one tries to access with Chrome Mac. It is alright with anything else…

Since this thread was brought back up, I’ll note that there is now a doc page on this topic that covers both Build Steps and iTunes File Sharing.

I know we are not any younger, neither does this thread, but the link is now broken, and I could not find it back with search :wink:

I found this, but I don’t know if it’s the same thing (no version in the wayback machine)

This is the updated link:

One thing to be wary of using Filesharing to add a database or any other file to your app.
The user has full access to it via iTunes, and could delete any file … or potentially worse ADD files that you app can’t handle.
So be sure that you include enough exception handling to deal with missing or invalid files

The solution is very simply to create a hidden folder.

For instance I use a folder name .com.matchsoftware.checkprintr to save all defaults and important files, while allowing iTunes file sharing. The hidden folder does not appear so it is not possible for the user to mess that up.

If the user is to add a file, I can vet it before loading it.

if you are going to hide the file/folder, why bother invoking filesharing in the first place?
If not visible, then the user cannot “share” it

You don’t understand. There is no simple way to access ApplicationData. So instead, I use a hidden folder to save my settings and stuff.

But the user has access to Documents to exchange files.

Your fear that the user deletes sensitive file is not justified if the said precious databases are away from his sight. Yet, he will be able to get the files saved by the app, or add files to load/process in the app.

I do understand, and invisible folder is accessible only by the app since everything must be in /RESOURCES (read only) or in /DOCUMENTS (read/write) (and yes there are ways to do inter-app access)… but the question in this topic was getting a database into and out of the app… therefore an invisible folder cannot be part of that solution, since iTunes will not allow access to it via filesharing.

I have a pretty good idea of the topic, since I was the first responder.

I was replying to your well funded objection.

What I do is give access to a COPY of the database, not the whole shabam, so if the user messes up, my app still works. Elementary security. The user has a button to export, and another to import.

Now, we are discussing Jim’s app, and my advice is still destined to him. I do believe making sure the user does not have access to critical files is paramount to avoid major support issues. You may do otherwise if you so choose.