title: EXC_BAD_ACCESS in sqlite_step(statement)
body: <p>I am using sqlite database for iphone app. but its crash on "while loop" line while retrieving data from database sometimes.</p>
  
  <pre><code>-(void)GetMethod
  {
  
      NSString *query = [[NSString alloc] initWithFormat:@"SELECT * FROM errorlogs"];
      sqlite3_stmt *statement;    
      if (sqlite3_prepare_v2(database, [query UTF8String],-1, &amp;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);
  }
  </code></pre>
  
  <p>why I am getting this EXC_BAD_ACCESS on while loop.</p>
  
  <p><img src="https://i.stack.imgur.com/DASgY.png" alt="enter image description here">
  Thanks.</p>