标签:数据 数组 date array ios nonatomic 读取 span blog
@property (nonatomic,strong) NSArray *imageData;//定义一个数组 -(NSArray *)imageDate { if(_imageDate==nil) { NSMutableDictionary *image1=[NSMutableDictionary dictionary]; image1["icon"]=@"a"; image1["title"]=@"测试一"; NSMutableDictionary *image2=[NSMutableDictionary dictionary]; image2["icon"]=@"a"; image2["title"]=@"测试二"; NSMutableDictionary *image3=[NSMutableDictionary dictionary]; image3["icon"]=@"a"; image3["title"]=@"测试三"; _imageData=@[image1,image2,image3]; } return _imageData; }
//读取数据 NSDictionary *imageDict=self.imageData[0]; self.icon.text=imageDict[@"icon"]; self.title.text=imageDict[@"title"];
ios手动添加数组字典(NSMutableDictionary)
标签:数据 数组 date array ios nonatomic 读取 span blog
原文地址:http://www.cnblogs.com/zqrios/p/7391045.html