我有一個XML文件,我需要計算元素在Objective-C中出現的次數。我應該怎麼做?在xml中使用目標c計算元素
<?xml version="1.0" encoding="ISO-8859-1"?>
<residents>
<resident id="1">
<name>
<first>David</first>
<last>Dollar</last>
</name>
</resident>
<resident id="2">
<name>
<first>Michael</first>
<last>Nipp</last>
</name>
</resident>
等等
您使用的是什麼xml讀取器? – Manuel 2012-04-26 20:29:24
我正在使用NSXMLParser。我需要代碼來計算元素出現的次數。 –
2012-04-26 20:34:37
對不起,我從來沒有真正使用NSXMLParser,因爲我發現TBXML更容易理解和使用。 – Manuel 2012-04-26 20:37:17