EXC_BAD_ACCESS in sqlite_step(statement)
crash, exc-bad-access, iphone, sqlite, xcode
Solution
Either `sqlite3_step(statement)` or `SQLITE_ROW` is not initialized, or has already been released. When it runs the equality check on the nonexistent object, it throws EXE_BAD_ACCESS.
Are you returning any rows?
Problem
I am using sqlite database for iphone app. but its crash on "while loop" line while retrieving data from database sometimes. ``` -(void)GetMethod { NSString *query = [[NSString alloc] initWithFormat:@"SELECT * FROM errorlogs"]; sqlite3_stmt *statement; if (sqlite3_prepare_v2(database, [query UTF8String],-1, &statement, nil) == SQLITE_OK) { while (sqlite3_step(statement) == SQLITE_ROW) **// EXC_BAD_ACCESS ON THIS LINE** { char *uid1 = (char *)sqlite3_column_text(statement, 0); NSString *uid = [NSString stringWithFormat:@"%s",uid1]; } } sqlite3_finalize(statement); } ``` why I am getting this EXC_BAD_ACCESS on while loop. Thanks.