I am having issues with the following code which loads an SQLite database.
- (NSArray *)getDatabase {
NSLog(@"Get Database Called");
NSMutableArray *retval = [[[NSMutableArray alloc] init] autorelease];
NSString *query = @"SELECT Description, UniqueID, HexCoords, NoHexCoords, NoAnnots, AnnotText, DescriptionFormatting, HexCoordsPortrait FROM MainTable";
sqlite3_stmt *statement;
if (sqlite3_prepare_v2(_database, [query UTF8String], -1, &statement, nil)
== SQLITE_OK) {
while (sqlite3_step(statement) == SQLITE_ROW) {
char *nameChars = (char *) sqlite3_column_text(statement, 0);
char *desChars = (char *) sqlite3_column_text(statement, 1);
int uniqueID = sqlite3_column_int(statement, 2);
From using breakpoints I can see that the problem is with the if statement and that the code never gets past this if statement. Can anyone spot what might be wrong ? The code was working a few months ago and I have recently upgraded to xCode 4.3 so might this be the problem ?
Thank in advance.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…