1.遍历map取出key和value存入OC字典
// 创建map
unordered_map<string, string> data;
params["device_id"] = "123456789";
params["channel"] = "iOS";
// 创建OC字典
NSMutableDictionary *dic = [NSMutableDictionary dictionary];
// 遍历map
for (unordered_map<string, string>::iterator it=data.begin();it!=data.end();++it) {
// 转成OC字符串
NSString *key = [NSString stringWithUTF8String:it->first.c_str()];
NSString *value = [NSString stringWithUTF8String:it->second.c_str()];
dic[key] = value;
}
NSLog(@"%@", dic);