SQLite3 database doesn't actually insert data - iPhone

前端 未结 3 643
南笙
南笙 2020-12-06 13:18

I\'m trying to add a new entry into my database, but it\'s not working. There are no errors thrown, and the code that is supposed to be executed after the insertion runs, m

3条回答
  •  温柔的废话
    2020-12-06 13:54

    Missing semicolon in your SQLite statement?

    NSString *query = [NSString stringWithFormat:@"INSERT INTO lists (name) VALUES('%@')", newField.text];

    I believe it should be:

    NSString *query = [NSString stringWithFormat:@"INSERT INTO lists (name) VALUES('%@');", newField.text];

    Although this might not be your only problem.

提交回复
热议问题