使用sqlite,在更新操作时每次报错“database is locked”

来源:互联网 发布:电脑恢复视频软件 编辑:程序博客网 时间:2024/05/17 03:39
+(XYZAnswers *)myAnswerWithDate:(NSString *)date{    NSString *sqlString = [NSString stringWithFormat:@"SELECT * FROM MyAnswers WHERE  dateString = '%@'",date];        sqlite3_stmt *statement = [[XYZSQLConnection shareSQLConnection] sqlPrepare:sqlString];    XYZAnswers *tempAnswer = [[XYZAnswers alloc] init];    while (sqlite3_step(statement) == SQLITE_ROW)



在进行

sqlite3_step(statement) 操作后记得sqlite3_finalize(statement); 释放资源不然数据库出于自我保护,就会报这个错

0 0