嗨,我有一些 JSON 格式的数据,如下所示:
`contentJson=`[{"key1":"Value1","key2":"Value2","key3":"Value3","key4":"Value4","key5":"Value5","key6":"Value6","key7":"Value7", "key8":"Value8"},{"key1":"Value1","key2":"Value2","key3":"Value3","key4":"Value4","key5":"Value5","key6":"Value6","key7":"Value7", "key8":"Value8"}]
如何将所有数据保存到 Sqlite 数据库中的一个字段?
我的代码是
NSString *statement = [[NSString alloc]initWithFormat:@"INSERT INTO mydatabase(contentJson,ID) VALUES(\"%@\",%d)",contentJson,ID];
但它没有插入任何东西。如果我通过 SQlitemanager 手动插入,那么我会收到错误,例如“Key1 ......
如果有人可以通过向我展示如何做到这一点来帮助我,我将不胜感激。