0

我正在使用这个 xmlreader。这是我的代码

NSDictionary *xmlDict = [XMLReader dictionaryForXMLString:responseString error:&error1];
NSLog(@"XMLData: %@",xmlDict);

我可以保存和记录数据,它看起来像这样。

response =     {
        Gpn0 =         {
            text = 10000;
        };
        Gsn0 =         {
            text = 4;
        };
        btn0 =         {
            text = up;
        };        
    };
}

但是我怎样才能访问这个字典中的单个元素呢?

4

1 回答 1

1
NSDictionary *gpn0 = response[@"Gpn0"];
NSNumber *gpn0_text = gpno[@"text"]; // note this is a numeric value

NSDictionary *btn0 = response[@"btn0"];
NSString *btn0_text = gpno[@"text"]; // note this is a string value    

so on and so forth
于 2013-05-14T20:13:04.490 回答