我在我的代码下面的语句:sqlite3_open - 无法打开数据库
NSString *docsDir;
NSArray *dirPaths;
dirPaths = NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES);
docsDir = [dirPaths objectAtIndex:0];
databasePath = [[NSString alloc] initWithString:[docsDir stringByAppendingPathComponent:@"Notebook.sqlite"]];
NSFileManager *fileMgr = [NSFileManager defaultManager];
const char *dbpath = [databasePath UTF8String];
NSLog(@"open sqlite at %s",dbpath);
if (sqlite3_open(dbpath, ¬eDB)==SQLITE_OK)
的NSLog
输出
/用户/ GinLin /库/应用程序支持/ iPhone模拟器/ 7.0 /应用/ CE1BAB1C-3DEC-4A1D-A083-537B0B51C99D /库/文档/ Notebook.sqlite
,但它似乎并没有被打开我的数据库。 而我无法在“/ CE1BAB1C-3DEC-4A1D-A083-537B0B51C99D/Library /”下找到文件夹“文档”。
任何人都可以帮忙吗?
是的!有用!非常感谢你 – Zheng