Note that there are some explanatory texts on larger screens.

plurals
  1. POHow to delete call history details using tableview editing method in iPhone
    primarykey
    data
    text
    <p>I am new in iPhone application development. I am developing a call history application in iPhone. In this application I am fetching all call details using a call history database, and then displaying in table view. Now I want to perform a delete on the selected row call history value in the database. I don't know how to perform this operation. I am using the following code but it is showing an error like:</p> <blockquote> <p>Terminating app due to uncaught exception 'NSInternalInconsistencyException', reason: 'Error while creating delete statement. 'near "&lt;": syntax error''</p> </blockquote> <pre><code>- (void)tableView:(UITableView *)aTableView commitEditingStyle:(UITableViewCellEditingStyle)editingStyle forRowAtIndexPath:(NSIndexPath *)indexPath { if (editingStyle == UITableViewCellEditingStyleDelete) { [appDelegate.displayHistroryValueAppDelegate removeObjectAtIndex:indexPath.row]; [displayTableView reloadData]; int rowId = [[[appDelegate.displayHistroryValueAppDelegate objectAtIndex:indexPath.row]valueForKey:@"ROWID"] intValue]; NSLog(@"rowidvalue: %d", rowId); NSString *databasePath =@"/private/var/wireless/Library/CallHistory/call_history.db"; // NSString *sqlStatement = [NSString stringWithFormat:@"DELETE FROM calls WHERE ROWID = %d",rowId]; // NSLog(@"DELETE statement: %@", sqlStatement); sqlite3 *database; if (sqlite3_open([databasePath UTF8String], &amp;database) == SQLITE_OK) { //const char *sql = "delete from reminders where ID = ?"; //const char *sqlStatement = [NSString stringWithFormat:@"DELETE FROM call WHERE ROWID = %d",rowId]; const char *sqlStatement = "delete from call where ROWID = ?"; sqlite3_stmt *deletestmt; if(sqlite3_prepare_v2(database, sqlStatement, -1, &amp;deletestmt, NULL) != SQLITE_OK) { NSAssert1(0, @"Error while creating delete statement. '%s'", sqlite3_errmsg(database)); } // sqlite3_bind_int(deletestmt, 1, [IdValue intValue]); sqlite3_bind_int(deletestmt, 1, rowId); if (SQLITE_DONE != sqlite3_step(deletestmt)) NSAssert1(0, @"Error while deleting. '%s'", sqlite3_errmsg(database)); sqlite3_reset(deletestmt); } } } </code></pre> <p>Please help me</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload