我iOS應用在Xcode模擬器終止由於EXC_BAD_INSTRUCTION(代碼= EXC_i386_INVOP)錯誤上下面的行iOS應用上sqlite3_reset崩潰與EXC_BAD_INSTRUCTION
sqlite3_reset(stmt);
的代碼的完整塊是
-(BOOL)containsPendingSignature
{
sqlite3_stmt *stmt = nil;
const char* sql = "SELECT Count(*) FROM pending_signatures";
if(sqlite3_prepare_v2(database, sql, -1, &stmt, NULL) != SQLITE_OK)
NSAssert1(0, @"Error:'%s'", sqlite3_errmsg(database));
int rowCount = 0;
if(sqlite3_step(stmt) == SQLITE_ROW) {
rowCount = sqlite3_column_int(stmt, 0);
}
sqlite3_reset(stmt);
sqlite3_finalize(stmt);
return rowCount > 0;
}
能任何一個請在這裏建議有什麼問題,提前謝謝。
那是因爲你沒有在每次使用後關閉數據庫..... – Dhiru
https://stackoverflow.com/questions/40394876/sqlite -error-exc-bad-instruction-code-exc-i386-invop-subcode-0x0-ios看看這個,,,,,, – Dhiru