【发布时间】:2021-01-16 23:56:02
【问题描述】:
我有两个这样的数组...
idArray : [123, 456, 789]
theRowIdArray: ["2", "3", "4"]
这里的theRowIdArray 对应于我在数据库中的表的行。 idArray 对应于我必须在表中的列中针对行更新的值。
如何以可以更新表中行的格式合并这两个数组。我觉得这可以使用字典来实现..但不确定如何...
我想要这样的东西......
for (id, rowID) in myDataset { //Here `myDataset` will contain the elements of both arrays
Update myTable Set theIDColumn = id Where Row_Id = rowID //Here will be code to update DB
}
【问题讨论】:
标签: ios swift dictionary