3

I have developed a custom ios framework for achieving some task, which is working perfectly but I have to add my sqlite database separately in my test app. I want to bind my sqlite database with my custom framework so that it will automatically added in any app where user want to user that framework.

I also don't want to show sqlite database to anyone. can anyone please tell me the best way to achieve this.

Cœur
  • 37,241
  • 25
  • 195
  • 267
Vinod Singh
  • 1,374
  • 14
  • 25

2 Answers2

0

I believe you're looking to ship a sqlite database with your app, and have it installed invisibly to the user. Just add the database to your NSBundle, by including it in the application. The important part is that you must copy this bundled database to the file system (you probably want to also mark it as not being in the cloud), because the NSBundle'd files are read-only. So, here's your strategy: 1) on startup, check to see if the database is in the file system. 2) if not, copy it from the NSBundle to the file system, 3) open the database in the file system.

Owen Hartnett
  • 5,925
  • 2
  • 19
  • 35
  • I want to distribute my framework N people, but don't want them to see the content of sqlite. I am looking for a solution which allow me to bind database with my custom framework, so if user add framework in their app database will automatically with framework just like a image bundle. – Vinod Singh Aug 12 '14 at 14:10
0

Maybe there is a better solution to your question but here is a suggestion on what you could: Programmatically create the database in your framework. As for hiding the database here is the solution to that! You may also encrypt the sqlite file.

Cheers

Community
  • 1
  • 1
pnizzle
  • 6,243
  • 4
  • 52
  • 81