iOS Loading Pre-filled sqlite database into your app

AndyCodez

macrumors regular
Original poster
Aug 6, 2009
187
0
I've been trying to get this going for a while. My main goal is to use a pre-filled database within my app instead of filling on first load. Due to that I'm loading 1600 rows from a csv file and it takes wayyy to long.

I've tried a couple different methods while adding it to the resources in xcode. Is there something simple I am missing here? Doesn't work like images and sound apparently.

Thanks for any help you offer ;)
 

tutukun

macrumors newbie
Nov 19, 2009
9
0
I've been trying to get this going for a while. My main goal is to use a pre-filled database within my app instead of filling on first load. Due to that I'm loading 1600 rows from a csv file and it takes wayyy to long.

I've tried a couple different methods while adding it to the resources in xcode. Is there something simple I am missing here? Doesn't work like images and sound apparently.

Thanks for any help you offer ;)
If you have someway to read sqlite file, i think you dont have to add it to the resource. just use direct path to open the file.
 

kainjow

Moderator emeritus
Jun 15, 2000
7,958
5
Add it to the Resources group, and make sure it is listed under the Copy Bundle Resources group under Target > [Your App]. Then you can use NSBundle to get the absolute path of the file.
 

AndyCodez

macrumors regular
Original poster
Aug 6, 2009
187
0
That worked great! Accept It seems the database is read only. I had a table that was used for score keeping and when the app tries to write to the database it isn't saving.

Do you know of read-only issues with using these pre-filled databases?

EDIT: Nevermind, found out resources group is read-only.
 
Register on MacRumors! This sidebar will go away, and you'll see fewer ads.