Reputation: 1154
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.
Upvotes: 1
Views: 3062
Reputation: 1154
The above problem is due to multiple write process to the DB. I synchronized the DB operations. Thanks for suggestions.
Upvotes: 5
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