我在尝试打开数据库时收到“没有这样的 VFS”错误消息。下面是我用来打开的代码
- (sqlite3 *) getNewConnection
{
sqlite3 *newconnection;
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *path = [documentsDirectory stringByAppendingPathComponent:@"databasename.sqlite"];
if (sqlite3_open([path UTF8String], &newconnection) == SQLITE_OK)
{
NSLog(@"Succesfully opened");
}
else
{
NSLog(@"DB Error: %s",sqlite3_errmsg(newconnection));
}
return newconnection;
}
这是我在控制台中打印的错误消息
“没有这样的vfs:”
请帮我解决这个问题。