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.
Asked
Active
Viewed 98 times
1 Answers
2
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.

Tim
- 8,932
- 4
- 43
- 64
-
Actually i forgot to add the link to 'copy bundle resources'. Its my fault. Anyway thanks for your help. – Bazi Paleri Mar 16 '16 at 07:57
-
is there a way to do same for android. to access from raw folder ? – Bazi Paleri Mar 17 '16 at 10:31
-
1This is another question. – Tim Mar 17 '16 at 12:46
-
http://stackoverflow.com/questions/36060140/can-i-open-a-read-alone-database-from-res-asset-folder-in-android-without-copyin/36060296#36060296 – Bazi Paleri Mar 18 '16 at 06:14