我正在寻找一种有效且简单的方法来总结 NSDictionary 中的所有值。
例如,如果我有 NSDictionarys,例如:
NSDictionary * first = @{@"A": [NSNumber numberWithInt:1],
@"B": [NSNumber numberWithInt:2],
@"C": [NSNumber numberWithInt:3],
@"D": [NSNumber numberWithInt:4]};
NSDictionary * second = @{@"A": [NSNumber numberWithInt:1],
@"B": [NSNumber numberWithInt:2],
@"C": [NSNumber numberWithInt:3],
@"D": [NSNumber numberWithInt:4]};
我想获得一个NSDictyonary
NSDictionary * sum = @{@"A": [NSNumber numberWithInt:2],
@"B": [NSNumber numberWithInt:4],
@"C": [NSNumber numberWithInt:6],
@"D": [NSNumber numberWithInt:8]};