ios用sqlite3_open打不开数据库的问题

问问,关于ios添加sqlite3的问题,我用这两种方法打开数据库都不行,xcode也添加数据库文件

string dbPath = CCFileUtils::sharedFileUtils()->fullPathFromRelativeFile(“test.db”,“test.db”);
result = sqlite3_open(dbPath.c_str(), &pDB);

string dbPath = CCFileUtils::sharedFileUtils()->getWritablePath()+“test.db”;
result = sqlite3_open(dbPath.c_str(), &pDB);
第一种返回错误14。第二种返回0,0是正确,但断点一直sqlite3_open停留,不走下一步

。。。。。。可能路径不大对
CCFileUtils::sharedFileUtils()->getWriteablePath()+“test.db”;
试试

版主大大,我打印了数据库的路径是这样“/Users/good/Library/Application Support/iPhone Simulator/7.1/Applications/F34308DC-C181-4985-9078-DE9C038F9071/Documents/test.db”。我用终端进去是有test.db这个文件,很奇怪就是打不开

这里就是writeblepath啊 你放别的地方肯定打不开

没有权限啊