search

Home  >  Q&A  >  body text

objective-c - iOS FMDatabase插入时 返回YES 但是就是插不进数据库 这是为什么

result = [_db executeUpdate:@"INSERT INTO CommentNotice (is_read,comment_id) VALUES (?,?)",temp[@"is_read"],temp[@"comment_id"]];

result返回YES 但是我去本地数据库看 结果没插进去这是为什么

PHPzPHPz2943 days ago645

reply all(3)I'll reply

  • 巴扎黑

    巴扎黑2017-04-17 16:40:30

    Where is the db stored?

    reply
    0
  • ringa_lee

    ringa_lee2017-04-17 16:40:30

    1. Check whether your sqlite file is under Document

    2. Have you opened the transaction and not committed

    reply
    0
  • 迷茫

    迷茫2017-04-17 16:40:30

    Copy the db from the application and take a look,

    Print the value before inserting.

    It’s best to test it with sql tool before writing

    reply
    0
  • Cancelreply