从嵌套的 NSDictionary 中获取值
在尝试了 100 次之后,我求助于 SO。
我使用 libxml2 从 html 解析器的字典中获得此输出
{
nodeChildArray = (
{
nodeAttributeArray = (
{
attributeName = class;
nodeContent = imgContainer;
}
);
nodeChildArray = (
{
nodeAttributeArray = (
{
attributeName = src;
nodeContent = "/~/media/Images/Image 2.ashx";
},
{
attributeName = alt;
nodeContent = "Image 2";
},
{
attributeName = width;
nodeContent = 60;
},
{
attributeName = height;
nodeContent = 112;
}
);
nodeName = img;
}
);
nodeName = div;
}
);
nodeName = td;
},
我试图获取 /~/media/Images/Image 2.ashx... 的 nodeContent 的输出...
有什么想法我的迭代应该是什么样子吗?
After trying 100 attempts at this im resorting to SO.
I have this output in dictionary from an html parser using libxml2
{
nodeChildArray = (
{
nodeAttributeArray = (
{
attributeName = class;
nodeContent = imgContainer;
}
);
nodeChildArray = (
{
nodeAttributeArray = (
{
attributeName = src;
nodeContent = "/~/media/Images/Image 2.ashx";
},
{
attributeName = alt;
nodeContent = "Image 2";
},
{
attributeName = width;
nodeContent = 60;
},
{
attributeName = height;
nodeContent = 112;
}
);
nodeName = img;
}
);
nodeName = div;
}
);
nodeName = td;
},
I am trying to get the of nodeContent that is /~/media/Images/Image 2.ashx...
Any ideas how should my iteration look like?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您的访问代码应该看起来像
我正在使用 0 您可以通过循环运行直到数组计数来获取它。
确保您的数组具有对象或创建正确的 if else 结构并将其分解为单独的语句。那么它应该看起来像
your code for access should look like
i am using 0 you can get it with from a loop runs upto count of array.
make sure your array having objects or make a proper if else structure and break this into separate statements. then it should look like