0

I created an sqlite3 database using navicat and then added to my XCode project. When my applications runs all the queries execute fine. But there is no database in the documents folder of the simulator. Where is the database being saved?

2 Answers 2

1

Assuming you haven't copied the database into your Documents directory, then it'll be in your app's main bundle, which is at <AppName>.app at the root of your application.

You can't write to that file.

If you want to make changes to this file you'll have to copy it from there to your Documents directory.

Sign up to request clarification or add additional context in comments.

2 Comments

You copy it in code the first time the app runs. You'd then open the sqlite file in the documents directory instead of the one in the bundle. stackoverflow.com/questions/6545180/… has some sample code for copying a file from the bundle to your documents directory.
Thanks a lot for your help it works. This should work on the phone itself also right ?
0

Inserting a data into SQLite (using FMDB) doesn't work on device?

Check my Answer on this Question. It is pretty much the same.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.