will like to know how do i determine dictionary root header, i will scan a QR code to get a link which will then convert the xml into a dictionary. i need to determine the header <image> or <audio>
as i need to retrieve differ data from them.
thanks for the feedback.
i have this 2 XML
<image>
<postID>999</postID>
<title>picture question</title>
<question>What is that?</question>
<hint></hint>
<content>http://test.com/download.jpg</content>
<direction>Right</direction>
<answer1>a</answer1>
<answer2>b</answer2>
<answer3>c</answer3>
<answer4>d</answer4>
<correctAnswer>b</correctAnswer>
<score>10</score>
</image>
<audio>
<postID>333</postID>
<title>audio question</title>
<question>Who is talking?</question>
<hint></hint>
<content>http://test.com/autobots.mp4"</content>
<direction>Up</direction>
<answer1>1</answer1>
<answer2>2</answer2>
<answer3>3</answer3>
<answer4>4</answer4>
<correctAnswer>2</correctAnswer>
<score>40</score> </audio>
Try to use AllKeys
Or
Check the valueForKey: method and test the response for both “image” & “audio”. If its nil for one then go with the other key.