我覺得我的openDB法「因未捕獲的異常‘NSInternalInconsistencyException’,原因終止應用程序:‘數據庫failesad打開’」創造這個錯誤---。NSInternalInconsistencyException未捕獲的異常而SQLite數據庫
任何想法如何解決這一問題?我正在運行xcode 4.6
-(NSString *) filePath {
NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentationDirectory, NSUserDomainMask, YES);
return [[paths objectAtIndex:0] stringByAppendingPathComponent:@"bp.sql"];
}
-(void) openDB {
if (sqlite3_open([[self filePath] UTF8String], &db) != SQLITE_OK) {
sqlite3_close(db);
NSAssert(0, @"Database failesad to open");
} else {
NSLog(@"database opened");
}
}
你寫過代碼將數據庫從應用程序包複製到設備目錄? –
我不確定你的意思。我是新手。 – Jeremy
你的sqlite數據庫位於哪裏? –