vendredi 26 juin 2015

get path for imported database in app's resource bundle swift

I have imported a Database that I made with a database browser into my swift. Now my problem is getting the path to this database. I have a FMDB wrapper in the app as well.

When I click on the resource file the Full Path description is displayed and I can use that as the path directly and I have no problem querying the database but I am not sure if that full path can be shipped with the app because it looks like it goes specifically through this computer. I tried using NSBundle.mainBundle().pathForResource("MyDatabaseName", ofType: "sqlite") but that returns nil

Basic Question: How do i get the path for my resource file/database file so that I can use it?

Thanks for any help! Super Desperate!

Aucun commentaire:

Enregistrer un commentaire