189 8069 5689

iOS数组里面取字典的值

NSArray *arrData = @[@"1",@"2",@"3",@"4"];
    NSArray *arrKey = @[@"A",@"B",@"C",@"D"];
    NSMutableDictionary *dic = [NSMutableDictionary dictionaryWithObjects:arrData forKeys:arrKey];
                   
    NSArray *arrData1 = @[@"5",@"6",@"7",@"8"];
    NSArray *arrKey1 = @[@"E",@"F",@"G",@"H"];
    NSMutableDictionary *dic1 = [NSMutableDictionary dictionaryWithObjects:arrData1 forKeys:arrKey1];
    NSMutableArray *arr = [NSMutableArray arrayWithObjects:dic,dic1, nil];
                   
    for (int i=0; i<[arr count]; i++) {
        for (id f in [arr objectAtIndex:i]) {
            NSLog(@"value = %@",[[arr objectAtIndex:i] valueForKey:f]);
            NSLog(@"key = %@",f);
        }
    }
    NSLog(@"arr = %@",[arr description]);

成都创新互联公司网站建设由有经验的网站设计师、开发人员和项目经理组成的专业建站团队,负责网站视觉设计、用户体验优化、交互设计和前端开发等方面的工作,以确保网站外观精美、网站设计、成都网站建设易于使用并且具有良好的响应性。

结果:

iOS  数组里面取字典的值


分享名称:iOS数组里面取字典的值
新闻来源:http://jkwzsj.com/article/pdpdio.html

其他资讯