FMDB: Is it good to remain an open database throughout the life cycle of an ios application?

I am confused about opening and closing a database for the FMDB wrapper class.

Is this a creation problem if I open the database in the applicationDidFinishLoading method of the AppDelegate class and do not close it until the application terminates?

Thank.

+5
source share
2 answers

From the official FMDB documentation:

Opening

Before you can interact with the database, you must open it. Opening fails if there are not enough resources or permissions to open and / or create the database.

if (![db open]) {
[db release];
return;
}

Closing

, , FMDatabase, SQLite , .

[db close];

, , , open close .

, , , .

: https://github.com/ccgus/fmdb

+5

, . .

+7

All Articles