我的代码中有以下语句:
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
是
/Users/GinLin/Library/Application Support/iPhone Simulator/7.0/Applications/CE1BAB1C-3DEC-4A1D-A083-537B0B51C99D/Library/Documentation/Notebook.sqlite
但它似乎没有打开我的数据库。而且我在“/CE1BAB1C-3DEC-4A1D-A083-537B0B51C99D/Library/”下找不到文件夹“文档”。
有人可以帮忙吗?