Checking for SQL db each time...

0 views
Skip to first unread message

marcio

unread,
Nov 16, 2009, 1:24:28 PM11/16/09
to iPhone Application Development Auditors
I have an app that checks to see if the local copy of a db exists in
the docs directory. So when i modify it, the next time i run the
simulator the mods dont show up. What would be the best way to avoid
this? Check some property of the files themselves to see if they are
the same and if not, copy them? Right now the files are not editable
via the app itself, i just modify the db directly on my mac, but
eventually they will be modifiable thru the app.

Gw33do

unread,
Nov 17, 2009, 9:29:32 AM11/17/09
to iPhone Application Development Auditors
Hey,

Assuming you've created the tables already in the database and its in
the doc directory, I would check to ensure you're telling the SQLite
database to commit the changes.

After the database is open and you've added stuff to it, make sure
you're calling sqlite3_step to execute and sqlite3_finalize to commit
your changes. This way you can keep data created while the application
is running.

Mike.

marcio

unread,
Nov 17, 2009, 12:36:42 PM11/17/09
to iPhone Application Development Auditors
no, i may have not explained myself. when i run the app in the
simulator, it copies the db to the local Docs directory on my mac.
and when i go back into the DB to make changes, the simulator runs the
app fine, but it doesnt get a fresh copy because it already exists in
the local Docs directory.

Mike Carter

unread,
Nov 17, 2009, 12:41:33 PM11/17/09
to iphone-appd...@googlegroups.com
I think I get what you're saying...
When you build and launch your code in the simulator, it's going to be
a "clean build" in the sim environment, which replaces files and the
like.
To get a better idea of how the persistency performs, quit and launch
the app only from within the simulator, not through the XCode menu.
> --
>
> You received this message because you are subscribed to the Google
> Groups "iPhone Application Development Auditors" group.
> To post to this group, send email to iphone-appd...@googlegroups.com
> .
> To unsubscribe from this group, send email to iphone-appdev-aud...@googlegroups.com
> .
> For more options, visit this group at http://groups.google.com/group/iphone-appdev-auditors?hl=
> .
>
>

 Michael Carter | avid...@me.com | 408.386.0288

Reply all
Reply to author
Forward
0 new messages