在 NSDictionary 中提取 nodeChildArray 的内容
我是一个新手,试图一起破解一个天气应用程序。该应用程序从天气 api 中提取数据,并使用 XPath 解析器和 libxml2
来获取数据。我已经对除 nodeChildArray
中包含的图标 url 之外的大部分数据进行了排序。
xnodes
是一个 NSMutableArray
,其中包含一周中每一天的以下数据:
nodeChildArray = (
{
nodeContent = "http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0003_white_cloud.png";
}
);
nodeName = weatherIconUrl;
我想要做的是从 nodeChildArray 内的 nodeContent 节点获取 url 这是我到目前为止所拥有的。
for ( NSDictionary *node in xnodes )
{
for ( id key in node )
{
if ([key isEqualToString:@"nodeChildArray"])
{
NSLog(@"Key output %@",key);
}
}
}
可以这么说,我如何深入了解这些键?
Im a newbie trying to hack a weather app together. The app pulls down data from a weather api and uses a XPath parser along with libxml2
to grab the data. I have sorted most of the data apart from the icon url which is contained within a nodeChildArray
.
xnodes
is an NSMutableArray
which contains the following data for each day of the week:
nodeChildArray = (
{
nodeContent = "http://www.worldweatheronline.com/images/wsymbols01_png_64/wsymbol_0003_white_cloud.png";
}
);
nodeName = weatherIconUrl;
What I want to do is grab the url from the nodeContent node within the nodeChildArray
This is what I have so far.
for ( NSDictionary *node in xnodes )
{
for ( id key in node )
{
if ([key isEqualToString:@"nodeChildArray"])
{
NSLog(@"Key output %@",key);
}
}
}
How do I drill down the keys so to speak?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
搞定了,确实很简单
Worked it out, pretty simple really