I want to parse a XML to NSArray. The XML is return from a web API.
And I have tried to turn XML into JSON and then use dictionary.
But when XML include not English word, the text of JSON will be garbled.
Is there any way or SDK can turn xml to array directly?
XML like this :
<xml>
<ns:return>
<addDate>2014-12-02</addDate>
<chid>111</chid>
</ns:return>
<ns:return>
<addDate>2014-12-03</addDate>
<chid>222</chid>
</ns:return>
</xml>
Turn xml into array like this:
NSArray addDate = [NSArray arrayWithObjects:@"2014-12-02",@"2014-12-03", nil];
NSArray chid = [NSArray arrayWithObjects:@"111",@"222", nil];