ios 将一个字典键值添加到另外一个字典中

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 中

你可能感兴趣的:(ios 将一个字典键值添加到另外一个字典中)