//
// main.m
// 数组字典结合
//
// Created by 博博 on 16/1/8.
// Copyright (c) 2016年 com.bb. All rights reserved.
//
#define NSLog(FORMAT, ...) printf("%s\n", [[NSString stringWithFormat:FORMAT, ##__VA_ARGS__] UTF8String])
#import <Foundation/Foundation.h>
int main(int argc, const char * argv[]) {
@autoreleasepool {
// NSDictionary *dic1=@{@"name":@"小阳",@"class":@"iso6",@"age":@"24"};
// NSDictionary *dic2=@{@"name":@"小明",@"class":@"iso8",@"age":@"67"};
// NSMutableArray *muarr=[NSMutableArray array];
//
//
// [muarr addObject:dic1];
// [muarr addObject:dic2];
//
// for(int i=0;i<muarr.count;i++){
// NSDictionary *dic= muarr[i];
// NSLog(@"班级:%@,姓名:%@,年龄:%@",dic[@"class"],dic[@"name"],dic[@"age"]);
// }
//
//
// NSString *name=@"wang";
// NSInteger age=50;
// NSString *work=@"haha";
// //以上数据存储字典形式 ,并以字符串输出
// NSDictionary *dic=@{@"name":name,@"age":@(age),@"work":work};
// NSLog(@"姓名:%@,年龄:%@,工作:%@",dic[@"name"],dic[@"age"],dic[@"work"]);
NSMutableDictionary *dic=[[NSMutableDictionary alloc]init];
[dic setDictionary:@{@"name":@"wcy",
@"age":@"22",
@"work":@"daozhang"
}];
[dic setDictionary:@{@"name":@"xiaoming",
@"age":@"26",
@"work":@"student"
}];
NSLog(@"%@",dic);
}
return 0;
}