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?
Asked
Active
Viewed 741 times
2 Answers
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.

Sherman Lo
- 2,759
- 20
- 20
-
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. http://stackoverflow.com/questions/6545180/ios-copy-a-file-in-documents-folder has some sample code for copying a file from the bundle to your documents directory. – Sherman Lo Aug 06 '12 at 09:56
-
Thanks a lot for your help it works. This should work on the phone itself also right ? – VBK Aug 06 '12 at 10:08
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.