我正在制作一个从XML / RSS提要中填充的组表,我已经设法将数据解析到表中,但我仍然坚持如何将表分组?
即,我想要一个事件列表,我想组织事件,使用每个组的月份,我将如何实现这一目标?
下面是我的XML结构,非常基本的
<EventsUpcoming>
<Event id="1">
<month>July</month>
<title>Ian Moss</title>
<date>Saturday, July 1st</date>
<ticket>$35 On the door</ticket>
<description>
Ian Moss from Cold Chisel fame will be touring Australia and the only venue to secure him in Perth is the Blvd.
</description>
</Event>
<Event id="2">
<month>August</month>
<title>Cold Chisel</title>
<date>Saturday, August 3rd</date>
<ticket>$25 on the door</ticket>
<description>
From Khe San fame, Cold Chisel is back with the legendary Jimmy Barnes, dont miss out this gig. Its gonna go down in the books for sure!
</description>
</Event>
<Event id="3">
<month>September</month>
<title>Australian Crawl</title>
<date>Saturday, September 1st</date>
<ticket>Free</ticket>
<description>
They're one of Australia's most iconic band names, be sure to come down and check them out before they die.
</description>
</Event>
</EventsUpcoming>
如果有人知道任何可能有用的教程网站,或者只是提示如何进行此操作,那将非常感激。在此先感谢:)
答案 0 :(得分:0)
NSMutableSet不存储重复值,它只存储不同的值。因此,在解析时,您可以使用NSMutableSet存储每个xml元素的'month'值并设置section的数量在tableview中查看NSMutableSet的计数。