当前位置: 动力学知识库 > 问答 > 编程问答 >

objective c - No such VFS error sqlite ios

问题描述:

I am getting "No Such VFS" error message while trying to open database. Below is the code i used to open

- (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;

}

Here is the error message i got printed in console

" no such vfs:"

Please help me out to fix this issue.

分享给朋友:
您可能感兴趣的文章:
随机阅读: