问题描述
- IOS项目中遇到问题,请各位大神帮帮忙,在线急等!!谢谢
-
“list={{q="gggggg",a="rrrrrrrr"},{q="gggggg",a="rrrrrrrr"},{q="gggggg",a="rrrrrrrr"}}”有这种样式的一组数据,我放在data中,怎么样才能取出,每个q,a相对应的值!请各位大神帮忙,在线等!
解决方案
先解析出list这个字典;然后遍历这个字典 当然得看你最外层是数组还字典,我默认你是字典
NSDictionary *listDic = [dic objectForKey:@"list"];
for (NSDictionary dic1 in listDic) {
NSString *q = [dic1 objectForKey:@"q"];
NSString *a = [dic1 objectForKey:@"a"];
}
解决方案二:
谢谢,按照你的方法,果然找到了对应的值!
时间: 2025-01-02 20:19:30