Dilip Lilaramani
Dilip Lilaramani

Reputation: 1154

Crashing on sqlite3_step line?

Crashing on sqlite3_step line?

I am just deleting the row from the database. It throws EXC_BAD_ACCESS sometimes not always.

Below is the screenshot of code.

Any suggestions guys.

enter image description here

Upvotes: 1

Views: 3062

Answers (2)

Dilip Lilaramani
Dilip Lilaramani

Reputation: 1154

The above problem is due to multiple write process to the DB. I synchronized the DB operations. Thanks for suggestions.

Upvotes: 5

Vimal Venugopalan
Vimal Venugopalan

Reputation: 4091

You have not opened the database using

if(sqlite3_open([databaseName UTF8String], &database) == SQLITE_OK)
{
      // perform your operations here e.g. delete, insert, update
}
else
{
      NSString *databaseName = [self.GetDocumentDirectory stringByAppendingPathComponent: @"yourDatabaseName.sqlite"];
      sqlite3_open([databaseName UTF8String], &db);

      // perform your operations here e.g. delete, insert, update
}

Refer Deleting Records in this

Upvotes: 1

Related Questions