如何将字典添加到数组
1、相关代码如下:NSArray *array=[[NSArray alloc]initWithObjects:@"1",@"2", nil];NSMutableDictionary *dict=[[NSMutableDictionary alloc]init];[dict setValue:array forKey:@"key"]

1、for (NSDictionary *company in _dataSource) {NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithDictionary:company];if ([company[@"FirmName"] isEqualToString:_currentCompany]) {[dic setObject:_district forKey:@"district"];}}...

1、Sub cz()
n = Now()
Dim d
Set d = CreateObject("Scripting.Dictionary")
Dim i, Sr, Yr As Long
Dim ShmxH, Yhdz, ShmxX
Sr = Range("H" & Rows.Count).End(xlUp).Row
ShmxH = Range("H2:H" & Sr)
ShmxX = Range("X2:X" & Sr)
'Workbooks.Open ThisWorkbook.Path & "\银行到账.xlsx"
Workbooks("银行到账").Activate
Yr = Range("E" & Rows.Count).End(xlUp).Row
Yhdz = Range("E2:H" & Yr)
For i = 1 To UBound(Yhdz)
d(Yhdz(i, 1) & "") = Yhdz(i, 4)
Next
For i = 1 To UBound(ShmxH)
If d.exists(ShmxH(i, 1) & "") Then
ShmxX(i, 1) = d(ShmxH(i, 1) & "")
Else
ShmxX(i, 1) = "N/A"
End If
Next
ThisWorkbook.Activate
Range("X2").Resize(UBound(ShmxX), 1) = ShmxX
Set d = Nothing
'Workbooks("银行到账").Close
MsgBox (Now() - n) * 24 * 3600 & "秒"
End Sub


1、1)get Dic B all keys,
2)从1)拿到keys进行遍历 for key in keys,
2.1) 如果key在A中已存在,根据需求操作,
2.2)如果不存在在A中进行 set forkey 操作。

