次のコードは、文字列 dbDate に格納されている Date(Primary Key) = 今日の日付である行の 2 つの列 (HoursWorked と TotalEarned) を更新することを想定しています。私の更新文字列が間違って書かれている可能性があると思います。アラート ビューがトリガーされています。
sqlite3_stmt *newstatement;
sql =[NSString stringWithFormat:@"UPDATE HourLog SET HoursWorked = '%@', TotalEarned = '%@' WHERE Date ='%@'", HoursWorked, TotalEarned, dbDate];
if(sqlite3_prepare_v2(db, [sql UTF8String], -1, &newstatement, nil)==SQLITE_OK){
NSLog(@"details updated");
UIAlertView *alertDialog;
alertDialog = [[UIAlertView alloc]
initWithTitle:@"Title"
message:@"Details Updated!"
delegate:nil
cancelButtonTitle:@"Close"
otherButtonTitles: nil];
[alertDialog show];
sqlite3_step(newstatement);
}
sqlite3_finalize(newstatement);
sqlite3_close(db);