@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[];
self.icon.text=imageDict[@"icon"];
self.title.text=imageDict[@"title"];