We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
(FMDatabaseQueue *)dbQueue { if (!_dbQueue) { NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:_dbName]; FMDatabaseQueue *fmdb = [FMDatabaseQueue databaseQueueWithPath:path]; self.dbQueue = fmdb; [_db close]; self.db = [fmdb valueForKey:@"_db"]; } return _dbQueue; }
(instancetype)initWithDBName:(NSString *)dbName path:(NSString *)dbPath { if (!dbName) { dbName = @"JQFMDB.sqlite"; } NSString *path; if (!dbPath) { path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:dbName]; } else { path = dbPath; }
FMDatabase *fmdb = [FMDatabase databaseWithPath:path];
if ([fmdb open]) { self = [self init]; if (self) { self.db = fmdb; self.dbName = dbName; return self; } } return nil; }
The text was updated successfully, but these errors were encountered:
非常感谢你的反馈, 此bug我已经修复~
Sorry, something went wrong.
No branches or pull requests
(FMDatabaseQueue *)dbQueue
{
if (!_dbQueue) {
NSString *path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:_dbName];
FMDatabaseQueue *fmdb = [FMDatabaseQueue databaseQueueWithPath:path];
self.dbQueue = fmdb;
[_db close];
self.db = [fmdb valueForKey:@"_db"];
}
return _dbQueue;
}
(instancetype)initWithDBName:(NSString *)dbName path:(NSString *)dbPath
{
if (!dbName) {
dbName = @"JQFMDB.sqlite";
}
NSString *path;
if (!dbPath) {
path = [[NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES) lastObject] stringByAppendingPathComponent:dbName];
} else {
path = dbPath;
}
FMDatabase *fmdb = [FMDatabase databaseWithPath:path];
if ([fmdb open]) {
self = [self init];
if (self) {
self.db = fmdb;
self.dbName = dbName;
return self;
}
}
return nil;
}
The text was updated successfully, but these errors were encountered: