Used to do an application, the inside used to fmdb, every operation before, all open, after the completion of the operation are close. Because I was referring to their previous code. The program did not find any problems at the beginning, after the completion of the program, a variety of stuttering appeared! Even though I was working on a new thread. After careful examination, it was found that the program used the CPU share on open and close unusually high, especially when the fast operation was tested. Later I found the following post, originally, with the wrong!
Http://stackoverflow.com/questions/15720272/when-to-close-sqlite-database-using-fmdb
The problem is:
When should you close the connection to an SQLite database (using in FMDB)? Right- I am closing it after running every batch of related queries and should I rather close when my app closes
? What is the pros/cons of doing either?
The answer is:
I'm the guy whowrote FMDB. Keep it open unless your change your schema. That's the only reason to close it, and constantly re-opening it's a little hits on Performance/batter Y life.
I Don't much IOS programming-so take my answer with a grain of salt. But no, I don ' are inatry out
IOS FMDB does not need to be closed