0

I have an iOS app structured more or less like so:

Controller1/View1
  Controller2/View2
    Controller3/View3
    Controller4/View4

Is it ok to instantiate a FMDatabase for each of the controllers, even if those databases all point to the same path? Or do I need to share a single FMDatabase instance across the classes?

FMDatabase locked, best practice for usage within class suggests using a queue, but is that strictly necessary or desired if everything is on the same thread?

Community
  • 1
  • 1
Andrew Stromme
  • 2,120
  • 23
  • 30

1 Answers1

0

I'd suggest using a single FMDatabaseQueue across your application as long as you have a single sqlite db. It takes care of access from multiple threads as well.

rounak
  • 9,217
  • 3
  • 42
  • 59