在我的应用程序中,每当用户按下注销按钮时,我都需要删除一个表并再次创建相同的表。为此,我使用此代码:
int result = sqlite3_open([databasePath UTF8String], &db);
if(result == SQLITE_OK)
{
const char *dropTable = "DROP table RegisterTable";
sqlite3_prepare_v2(db, dropTable,
-1, &statement, NULL);
if (sqlite3_step(statement) == SQLITE_DONE)
{
NSLog(@"table dropped");
}
else
{
NSLog(@"table not dropped");
}
}
else
{
NSLog(@"Not opened for dropping");
}
然而,每次我得到“桌子不掉线”..
答案 0 :(得分:0)