DB Error: 1 "unrecognized token: ":""

在网上查找http://blog.csdn.net/heihuifeng/article/details/6561615本文 。插入的字符串需加引號',

 [_db executeUpdate:[NSString stringWithFormat:@"INSERT INTO %@  (name,img,date,isCome,msg_type,message,isNew,sendFlag,personId) VALUES('%@','%@','%@','%@','%@','%@','%@','%@','%@')",userId,friendData.m_name,friendData.m_imgUrl,data.sendTime,@"1",data.textType,data.chatFileModelJson,@"1",@"3",data.entUserId]];

因为之前未加引号。

版权声明:本文博主原创文章。博客,未经同意不得转载。

原文地址:https://www.cnblogs.com/bhlsheji/p/4843216.html