我在我的代碼下面的語句: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