Note that there are some explanatory texts on larger screens.

plurals
  1. POIssue in deleting raw from table sqlite
    primarykey
    data
    text
    <p>this is what i am doing in header </p> <pre><code>static sqlite3 *database = nil; static sqlite3_stmt *deleteStmt = nil; @implementation SQLAppDelegate @synthesize window; @synthesize navigationController; @synthesize coffeeArray; </code></pre> <p>this is what i am using for deleting raw</p> <pre><code> - (void) removeCoffee:(NSNumber *)coffeeObj { NSLog(@"coffeeObj%@",coffeeObj); int myInteger = [coffeeObj integerValue]; NSLog(@"myInteger%d",myInteger); // print this myInteger0 NSLog(@"%@",coffeeArray); //print object if (sqlite3_open([self getDBPath], &amp;database) == SQLITE_OK) { NSLog(@"myInteger%@",[self getDBPath]); NSString *sql = [NSString stringWithFormat: @"delete from Coffee where CoffeeID =%d",myInteger]; const char *del_stmt = [sql UTF8String]; NSLog(@"%@",del_stmt); // getting print // print this delete from Coffee where CoffeeID =0. sqlite3_prepare_v2(database, del_stmt, -1, &amp; deleteStmt, NULL); NSLog(@"sqlite3_step(deleteStmt) == SQLITE_DONE%@",sqlite3_step(deleteStmt) == SQLITE_DONE); // this print null if (sqlite3_step(deleteStmt) == SQLITE_DONE) { //NSLog(@"hi") this is not getting print } else { //NSLog(@"hi") this is getting print } sqlite3_finalize(deleteStmt); sqlite3_close(database); [coffeeArray removeObjectAtIndex:myInteger]; NSLog(@"%@",coffeeArray); // object is deleted } } </code></pre> <p>my table is like below </p> <pre><code>table name = Coffee CoffeeID(INTEGER)=0 CoffeeName(VARCHAR)=Latte Price(REAL)=2.99 </code></pre> <p>where thing runs perfectly object get deleted from array and thats why its not appearing on table cell. but its not getting deleted from database table thats why it when i launch app again then it shows again please help what i am doing wrong.</p>
    singulars
    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.
 

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