When I run build ios5.0 or less, then the Sqlite answer is correct and retrieves the data, it works fine, but when I run on ios6.0 I try to retrieve the data from my.sqlite database, but it does not fulfill my if case. He always enters into another condition. What am I doing wrong? I can not execute my if if, i.e. if(sqlite3_prepare_v2(database, sqlQuerry, -1, &querryStatement, NULL)==SQLITE_OK).
check this code for reference.
NSLog(@"sqlite3_prepare_v2 = %d SQLITE_OK %d ",sqlite3_prepare_v2(sqlite, [strQuery UTF8String], -1, &compiledStatement, nil),SQLITE_OK); if(sqlite3_prepare_v2(sqlite, [strQuery UTF8String], -1, &compiledStatement, nil)==SQLITE_OK) { NSLog(@"sqlite3_step = %d SQLITE_ROW %d ",sqlite3_step(compiledStatement),SQLITE_ROW); while (sqlite3_step(compiledStatement)==SQLITE_ROW) { if(sqlite3_column_text(compiledStatement, 2) != nil) modelObj.Name = [NSString stringWithUTF8String:(char *)sqlite3_column_text(compiledStatement, 2)]; } } else { }
In iOS6.0 Print Magazine
sqlite3_prepare_v2 = 1 SQLITE_OK 0 sqlite3_step = 21 SQLITE_ROW 100
In iOS5.0 Print Magazine
sqlite3_prepare_v2 = 0 SQLITE_OK 0 sqlite3_step = 100 SQLITE_ROW 100
source share