Reputation: 275
I've tried using sqlite3_open statement, but the database is created at root level of my hard disk.
I can actually try to copy it to the bundle document folder. But,
Where will the database created if I execute it during the iPhone runtime? (Since I use iOS Simulator, it is created on root level).
How to create the database at the documents folder level immediately?
I'm sorry if I can't make myself clear enough, I'm really new working with database and stuffs.
Thank you for your attention.
Upvotes: 0
Views: 1379
Reputation: 2230
You should create database file template with no content, but with structure, that you plan to use in your app. Add this template to your project Resources
folder. Then, when app started, copy that file to Documents
folder and use it.
Upvotes: 1
Reputation: 11145
You can not write to the main bundle, because it is signed with SSL certificate. But you can write to the document directory. Have a look at this link of how to create database at runtime in documents directory - create sqlite db programmatically in iphone sdk
Upvotes: 1