The problem: populate a sqlite database when user starts the app at the first time.
Probable solution: i want to create a temporary file at development time with the desired data, read this file when user starts app for the first time and store it in a sqlite database. My doubt to implement this solution is: how I create a temporary file at development time that will be shipped with iPhone app and deleted after the sqlite database was populated? There is a way to indicate that a file must be placed in ‘Document Directory’ or ‘Temp Directory’ at development time? I dont want this file exists after I put all data on sqlite database.
If you have a different approach to my probable solution, fell free to tell me.
Thanks in advance.
You really can’t delete it, because the temporary fil needs to be in the bundle.
And the bundle is readonly.
I just pre-fill my SQLite database and copy it to the document directory if it is not there.
The prefilled SQLite file will stay in the bundle, there is no real way around this.