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 に答える