我正在运行以下选择查询,它在iOS 8.2之前可以100%工作。此查询在iOS 8.1和更早版本中返回了完美的结果集。该应用程序停留在sqlite3_step上,它将永久完成。有人知道为什么吗?我的应用卡在用户设备上。下面是查询和代码。
NSString *sqlStatement = @"Select W.woorde, R.woorde, W.woordIDs, R.woordIDs from masterWoorde W, masterWoorde R, masterWaardes WD, masterWoorde Rr where Rr.woorde LIKE ? And Rr.woordIDs=WD.skoonLeidraadID and WD.leidraadID=W.woordIDs and WD.resultaatID=R.woordIDs ORDER BY W.woorde COLLATE NOCASE, R.woorde COLLATE NOCASE";
if (prepareStatus == SQLITE_OK) {
sqlite3_bind_text(select_statement, 1, [dboObject.frases UTF8String], -1, SQLITE_STATIC);
while (sqlite3_step(select_statement) == SQLITE_ROW) {
productSModel * aProduct = [[productSModel alloc] init];
aProduct.frases = [NSString stringWithUTF8String:(char *)sqlite3_column_text(select_statement, 0)];
aProduct.ABC = [NSString stringWithUTF8String:(char *)sqlite3_column_text(select_statement, 1)];
aProduct.CDE = sqlite3_column_int(select_statement, 2);
aProduct.FGH = sqlite3_column_int(select_statement, 3);
[arrResult addObject:aProduct];
}
}
最佳答案
此问题可追溯到iOS 8.1和iOS 8.2之间的SQLite更改。见Sqlite3 query gets really slow under iOS 8.2