Changing DB

I’m in the process of writing and testing an ios app that a companion of a desktop app, using the same DB; copy of course.

The DB is copied for testing using the ios build process.

It appears the if I make changes to the DB using the desktop app the changes are not reflected in the ios’s copy of the DB.

Is there a way to force the build/simulator to get the updated db?

are you saying the changes are not in the iOS copy the next time you BUILD the iOS version?
or are you saying they changes don’t just “appear” when you change the desktop version?

The first I would expect to work, the second I would not, since each device has its own instance of the database file.

I have a similar situation (although I haven’t gotten to the “synch” stage yet). But what I plan to do is use iTunes filesharing to allow the desktop access to a copy of the iOS database, and then move the updated desktop database back to the i device. I hope you have a method in place (UUID?) to be able to tell which device added, deleted or changed a record so they CAN be synched.

Also, and I’m not sure if this is correct or not (Norman??), but the encryption between the desktop version and iOS version is not compatible??? If that is the case, you need to share an unencrypted version… but I may be wrong in the assumption about compatiblity.

I guess I did not explain my problem correctly. So here goes.

This only apples to Desktop Mac computer. Running the Simulator. Simulating iPad only (at this time).

Does NOT involve iTunes Sync.

  1. While testing ios app I find that the DB need some changes to so I can test a feature in the ios app.
  2. So I run the desktop app and modify the db with data to test the feature on the ios app.
  3. I then build and debut the ios app… the changes to the DB are not there.

My question is: What do I need to do between 2 and 3 so that I’m testing with a updated DB.

[quote=259574:@Jim Smith]I guess I did not explain my problem correctly. So here goes.

This only apples to Desktop Mac computer. Running the Simulator. Simulating iPad only (at this time).

Does NOT involve iTunes Sync.

  1. While testing ios app I find that the DB need some changes to so I can test a feature in the ios app.
  2. So I run the desktop app and modify the db with data to test the feature on the ios app.
  3. I then build and debut the ios app… the changes to the DB are not there.

My question is: What do I need to do between 2 and 3 so that I’m testing with a updated DB.[/quote]

It looks as if the iOS app has moved the db to memory. Maybe you should close it and reopen for changes in the file to take effect.

Ah… well in XCODE, you need to do a “Clean Project”, as each app/device combo gets its own “working space” in the simulator and that is not necessarily rebuilt on each compile.

HOWEVER, that is what XCODE does, I don’t know what Xojo for iOS does.

I thought you meant keeping a iOS version of the data in synch with a Desktop version . Which is what I am needing, as the iOS version of my app updates a database, and the desktop version can update its database, but at some point BOTH need to be reconciled and end up with the same data. Part of this requires that records NEVER be deleted (just marked as such) until the two platform synch.

Thank you. That is just what is happened. The code was in the OPEN event to delete and copy, but had commented it out.

Let me ask another question.

When app goes for apple review a test DB need to be in there (Resource) so app will be usable?

And when the user first get the app the test DB is there for the user, but only gets copied if not already in Doc folder so that when user iTunes Sysc his DB it will replace the test DB?

remember you need to modify your plist in order for itunes filesharing to see anything in the /document folder

<key>UIFileSharingEnabled</key>
	<true/>

More info about copying files to an iOS device:

Copying Files to the Device