iOS 将一个字典的键值对添加到添加到另外一个字典中的方法
e g :
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 中
网友评论