Apple开发_addEntriesFromDictionary用法, 其实就是拼接字典用的
1、addEntriesFromDictionary在字典中的用法:
NSMutableDictionary *dic1 = [NSMutableDictionary dictionaryWithObjectsAndKeys:@"BMW",@"CarLogo",@"Red",@"CarColor", nil];
NSDictionary *dic2 = [NSDictionary dictionaryWithObjectsAndKeys:@"Xiaoming",@"name",@"28", @"age",nil];
[dic1 addEntriesFromDictionary:dic2];
NSLog(@"%@",dic1);
- 看打印结果:
2、结论
- 就是拼接字典用的。
- addEntriesFromDictionary是NSMutableDictionary的一个方法。