ios 将一个字典键值添加到另外一个字典中
2020-07-29 本文已影响0人
Lee坚武
NSDictionary * dict = @{@"1":@"1",@"2":@"2"};
NSMutableDictionary * myHeader = [[NSMutableDictionary alloc] init];
[myHeader setValue:@"8" forKey:@"8"];
[myHeader setValue:@"9" forKey:@"9"];
[myHeader setValue:@"10" forKey:@"10"];
[myHeader addEntriesFromDictionary:dict];
可以将 dict 字典的键值对添加到 myHeader 中