Access pre-existing database(read only) from iOS bundle

100 views Asked by At

I have pre-created database stored in a folder inside my bundle. Can I access it directly from that folder without copying to Document folder?. I don't want to write anything to Db. Only want to read some data. I am using FMDB framework also.

1

There are 1 answers

4
Tim On BEST ANSWER

You can get the path to your database using:

NSString *path = [[NSBundle mainBundle] pathForResource:@"someDB" ofType:@"sqlite"];

Change the parameters to match your database. And then provide that path to your framework so you can access it.