我无法完全理解 NSXMLParser 的流程以及与它们关联的委托方法。是否有任何方式或任何示例详细解释如何使用 NSXMLParser 完成解析。我有另一个 XML,我需要在解析 XMl 后将相关的 qno、tin、tout 和 answer 存储到相应的字符串中。PFB XML。
<?xml version="1.0" encoding="UTF-8"?>
<ParticipantService>
<Response>
<FileName>CustomerSkillsIntro</FileName>
<playlist>
<question answer="t" qno="1" tin="71" title="Greet" tout="73"/>
<question answer="t" qno="2" tin="74" title="Have Name Tag" tout="77"/>
<question answer="t" qno="3" tin="78" title="Greet" tout="83"/>
<question answer="t" qno="4" tin="109" title="Helping Do My Job" tout="112"/>
<question answer="t" qno="5" tin="131" title="Greet Happily" tout="134"/>
<question answer="t" qno="6" tin="141" title="Stay cheerful when resident is crabby" tout="144"/>
<question answer="t" qno="7" tin="151" title="Bond with the new resident" tout="154"/>
<question answer="t" qno="8" tin="161" title="Welcome cheerfully" tout="164"/>
<question answer="t" qno="9" tin="169" title="Offer Help" tout="172"/>
<question answer="t" qno="10" tin="178" title="Help with interest" tout="181"/>
<question answer="t" qno="11" tin="183" title="Accompany" tout="186"/>
<question answer="t" qno="12" tin="189" title="Pay attention to 2 resudents" tout="192"/>
<question answer="t" qno="13" tin="199" title="Juggle the two accurately" tout="202"/>
<question answer="t" qno="14" tin="207" title="Bring in other help when needed" tout="212"/>
<question answer="t" qno="15" tin="219" title="Correct response I can ask" tout="222"/>
<question answer="t" qno="16" tin="231" title="Be charming" tout="237"/>
<question answer="t" qno="17" tin="247" title="Respond and delegate" tout="250"/>
<question answer="t" qno="18" tin="261" title="Apologize" tout="263"/>
<question answer="t" qno="19" tin="266" title="Offer activities" tout="270"/>
<question answer="t" qno="20" tin="273" title="Be sensitive to needs" tout="276"/>
<question answer="t" qno="21" tin="287" title="Offer anything you need" tout="290"/>
<question answer="t" qno="22" tin="311" title="Take off shoes, honor unusual request" tout="315"/>
<question answer="t" qno="23" tin="328" title="Always available menu explained" tout="331"/>
<question answer="t" qno="24" tin="333" title="Willing to stay beyond shift" tout="336"/>
<question answer="t" qno="25" tin="377" title="Explain policy" tout="380"/>
<question answer="t" qno="26" tin="390" title="Understand resident" tout="396"/>
</playlist>
<path>lmsstaging.2xprime.com</path>
<EncodedVideoURL>HTTP://lmsstaging.2xprime.com/test/vdos/Alzheimers.mp4</EncodedVideoURL>
</Response>
<RequestStatus>
<Code>1</Code>
<Status>SUCCESS</Status>
<Message/>
</RequestStatus>
</ParticipantService>
有人可以解释一下如何解析这个 XML 以及关于 NSXMLParser 和委托方法如何工作的详细解释吗?我想将“tin”和“tout”存储到 NSArray 中,但我无法理解如何逐个节点解析它。这将非常有帮助。