我整天都在为此苦苦挣扎,不知道我做错了什么。我有一个NSDictionary
NSDictionary*dict=[tutorialsNodes objectAtIndex:0];
当我NSLog(@"%@",dict);
返回以下...
{
nodeAttributeArray = (
{
attributeName = class;
nodeContent = style1;
}
);
nodeChildArray = (
{
nodeContent = "Number of Patrons Using Facility: 151";
nodeName = text;
},
{
nodeName = br;
},
{
nodeContent = "
\n Room Occupancy: 210 ";
nodeName = text;
},
{
nodeName = br;
},
{
nodeContent = "
\n Current Wait: 0 minutes ";
nodeName = text;
}
);
nodeName = p;
}
但是,当我输入以下代码时...
NSArray*dictArray=[dict objectForKey:@"nodeChildArray"];
NSLog(@"%@",dictArray);
它返回null
。我正在尝试从NodeChildArray
密钥中提取 nodeContent,但我什至无法提取密钥。不知道为什么它一直返回 null
修订
这是我正在执行的确切行...
//some HTML parsing before this
NSArray *tutorialsNodes = [tutorialsParser
searchWithXPathQuery:tutorialsXpathQueryString];
NSDictionary*dict=[tutorialsNodes objectAtIndex:0];
NSArray*dictArray=[dict objectForKey:@"nodeChildArray"];
NSLog(@"%@",dictArray);
它返回null
两次