0

I am having problems getting into an NSDictionary within another NSDictionary. I've been trying to access the text in the nodeContent key in the 0th index of the key nodeChildArray,"Number of Patrons Using Facility: 163". Here is the array.

{
nodeAttributeArray =     (
            {
        attributeName = class;
        nodeContent = style1;
    }
);
nodeChildArray =     (
            {
        nodeContent = "Number of Patrons Using Facility: 163";
        nodeName = text;
    },
            {
        nodeName = br;
    },
            {
        nodeContent = "
        Room Occupancy: 210 ";
        nodeName = text;
    },
            {
        nodeName = br;
    },
            {
        nodeContent = "
        Current Wait: 0 minutes ";
        nodeName = text;
    }
);
nodeName = p;
}

I have tried different variations of the following:

//I Parse some HTML using Xpath before this
NSArray *tutorialsNodes = [tutorialsParser    
searchWithXPathQuery:tutorialsXpathQueryString];

NSDictionary*dict=[tutorialsNodes objectAtIndex:0];
NSDictionary*dict2=[[dict objectForKey:@"nodeChildArray"]objectAtIndex:0];

So it should be returning both keys in the index but it keeps returning null. I'd really appreciate some help. Thanks!

4

1 回答 1

0

MainResultDictionary => 其中包含您的回复

你应该编码

NSArray *dictsArr = [MainResultDictionary objectForkey:@"nodeChildArray"];
NSdictionary *dict = [dictsArr objectAtIndex:0];
[dict objectForkey:@"nodeContent"];
于 2013-02-28T22:02:40.053 回答