Sqlite : insert 2 same row -> crash

Discussion in 'iOS Programming' started by namanhams, Jan 18, 2010.

  1. namanhams macrumors regular

    Jun 3, 2009
    Hi everyone,

    I just try to insert 2 rows into the table. The 2 rows are the same (all the column data are the same);

    The first insertion is successful. The second insertion just crashes the application. I have no idea why.

    Any one know about this ? THanks.
  2. robbieduncan Moderator emeritus


    Jul 24, 2002
    It would seem likely that you are violating some sort of uniqueness constraint in your database and not handling the failure/error correctly.
  3. namanhams thread starter macrumors regular

    Jun 3, 2009
    It's my silly error. I close the database after the first insertion, then forgot to open the database before the second one. :confused:

Share This Page